<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The University of Glasgow 2006
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998


Pattern-matching bindings (HsBinds and MonoBinds)

Handles @HsBinds@; those at the top level require different handling,
in that the @Rec@/@NonRec@/etc structure is thrown away (whereas at
lower levels it is preserved with @let@/@letrec@s).
-}</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-14"></span><span class="hs-pragma">{-# LANGUAGE TypeFamilies #-}</span><span>
</span><span id="line-15"></span><span class="hs-pragma">{-# LANGUAGE ViewPatterns #-}</span><span>
</span><span id="line-16"></span><span class="hs-pragma">{-# LANGUAGE FlexibleContexts #-}</span><span>
</span><span id="line-17"></span><span>
</span><span id="line-18"></span><span class="hs-pragma">{-# OPTIONS_GHC -Wno-incomplete-uni-patterns #-}</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.HsToCore.Binds</span><span>
</span><span id="line-21"></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsTopLHsBinds"><span class="hs-identifier">dsTopLHsBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsLHsBinds"><span class="hs-identifier">dsLHsBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#decomposeRuleLhs"><span class="hs-identifier">decomposeRuleLhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsSpec"><span class="hs-identifier">dsSpec</span></a></span><span>
</span><span id="line-22"></span><span>   </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier">dsHsWrapper</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsTcEvBinds"><span class="hs-identifier">dsTcEvBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsTcEvBinds_s"><span class="hs-identifier">dsTcEvBinds_s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsEvBinds"><span class="hs-identifier">dsEvBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsMkUserRule"><span class="hs-identifier">dsMkUserRule</span></a></span><span>
</span><span id="line-23"></span><span>   </span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-29"></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span>   </span><span class="annot"><a href="GHC.HsToCore.Expr.html"><span class="hs-identifier">GHC.HsToCore.Expr</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier">dsLExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="hs-pragma">{-# SOURCE</span><span> </span><span class="hs-pragma">#-}</span><span>   </span><span class="annot"><a href="GHC.HsToCore.Match.html"><span class="hs-identifier">GHC.HsToCore.Match</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.Match.html#matchWrapper"><span class="hs-identifier">matchWrapper</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-32"></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Monad.html"><span class="hs-identifier">GHC.HsToCore.Monad</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.GuardedRHSs.html"><span class="hs-identifier">GHC.HsToCore.GuardedRHSs</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.Utils.html"><span class="hs-identifier">GHC.HsToCore.Utils</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.html"><span class="hs-identifier">GHC.HsToCore.PmCheck</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.html#addTyCsDs"><span class="hs-identifier">addTyCsDs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.HsToCore.PmCheck.html#checkGuardMatches"><span class="hs-identifier">checkGuardMatches</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Hs.html"><span class="hs-identifier">GHC.Hs</span></a></span><span>             </span><span class="hs-comment">-- lots of things</span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>           </span><span class="hs-comment">-- lots of things</span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.SimpleOpt.html"><span class="hs-identifier">GHC.Core.SimpleOpt</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.SimpleOpt.html#simpleOptExpr"><span class="hs-identifier">simpleOptExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.OccurAnal.html"><span class="hs-identifier">GHC.Core.Opt.OccurAnal</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.OccurAnal.html#occurAnalyseExpr"><span class="hs-identifier">occurAnalyseExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Make.html"><span class="hs-identifier">GHC.Core.Make</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Arity.html"><span class="hs-identifier">GHC.Core.Opt.Arity</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Arity.html#etaExpand"><span class="hs-identifier">etaExpand</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Unfold.html"><span class="hs-identifier">GHC.Core.Unfold</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FVs.html"><span class="hs-identifier">GHC.Core.FVs</span></a></span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Graph.Directed.html"><span class="hs-identifier">GHC.Data.Graph.Directed</span></a></span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Predicate.html"><span class="hs-identifier">GHC.Core.Predicate</span></a></span><span>
</span><span id="line-49"></span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Names.html"><span class="hs-identifier">GHC.Builtin.Names</span></a></span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html"><span class="hs-identifier">GHC.Core.TyCon</span></a></span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html"><span class="hs-identifier">GHC.Tc.Types.Evidence</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Tc.Utils.TcType.html"><span class="hs-identifier">GHC.Tc.Utils.TcType</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Type.html"><span class="hs-identifier">GHC.Core.Type</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Coercion.html"><span class="hs-identifier">GHC.Core.Coercion</span></a></span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Multiplicity.html"><span class="hs-identifier">GHC.Core.Multiplicity</span></a></span><span>
</span><span id="line-57"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html"><span class="hs-identifier">GHC.Builtin.Types</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#typeNatKind"><span class="hs-identifier">typeNatKind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Builtin.Types.html#typeSymbolKind"><span class="hs-identifier">typeSymbolKind</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Make.html"><span class="hs-identifier">GHC.Types.Id.Make</span></a></span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Id.Make.html#proxyHashId"><span class="hs-identifier">proxyHashId</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Name.html"><span class="hs-identifier">GHC.Types.Name</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Rules.html"><span class="hs-identifier">GHC.Core.Rules</span></a></span><span>
</span><span id="line-63"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-64"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.html"><span class="hs-identifier">GHC.Types.Var</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier">EvVar</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-65"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-66"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span>
</span><span id="line-67"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-68"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Maybe.html"><span class="hs-identifier">GHC.Data.Maybe</span></a></span><span>
</span><span id="line-69"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html"><span class="hs-identifier">GHC.Data.OrdList</span></a></span><span>
</span><span id="line-70"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html"><span class="hs-identifier">GHC.Data.Bag</span></a></span><span>
</span><span id="line-71"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-72"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-73"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-74"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-75"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html"><span class="hs-identifier">GHC.Types.Unique.Set</span></a></span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Set.html#nonDetEltsUniqSet"><span class="hs-identifier">nonDetEltsUniqSet</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Monad.html"><span class="hs-identifier">GHC.Utils.Monad</span></a></span><span>
</span><span id="line-77"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-78"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-79"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#"><span class="hs-identifier">Data.List.NonEmpty</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="../../base/src/Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier">nonEmpty</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>
</span><span id="line-81"></span><span class="hs-comment">{-**********************************************************************
*                                                                      *
           Desugaring a MonoBinds
*                                                                      *
**********************************************************************-}</span><span>
</span><span id="line-86"></span><span>
</span><span id="line-87"></span><span class="hs-comment">-- | Desugar top level binds, strict binds are treated like normal</span><span>
</span><span id="line-88"></span><span class="hs-comment">-- binds since there is no good time to force before first usage.</span><span>
</span><span id="line-89"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsTopLHsBinds"><span class="hs-identifier hs-type">dsTopLHsBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-90"></span><span id="dsTopLHsBinds"><span class="annot"><span class="annottext">dsTopLHsBinds :: LHsBinds GhcTc -&gt; DsM (OrdList (EvVar, CoreExpr))
</span><a href="GHC.HsToCore.Binds.html#dsTopLHsBinds"><span class="hs-identifier hs-var hs-var">dsTopLHsBinds</span></a></span></span><span> </span><span id="local-6989586621681149390"><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149390"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-91"></span><span>     </span><span class="hs-comment">-- see Note [Strict binds checks]</span><span>
</span><span id="line-92"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; Bool
forall a. Bag a -&gt; Bool
</span><a href="GHC.Data.Bag.html#isEmptyBag"><span class="hs-identifier hs-var">isEmptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149387"><span class="hs-identifier hs-var">unlifted_binds</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; Bool
forall a. Bag a -&gt; Bool
</span><a href="GHC.Data.Bag.html#isEmptyBag"><span class="hs-identifier hs-var">isEmptyBag</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149385"><span class="hs-identifier hs-var">bang_binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-93"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsBind GhcTc)
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) ())
-&gt; LHsBinds GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; Bag a -&gt; m ()
</span><a href="GHC.Data.Bag.html#mapBagM_"><span class="hs-identifier hs-var">mapBagM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
-&gt; GenLocated SrcSpan (HsBind GhcTc)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall {a}.
Outputable a =&gt;
String -&gt; GenLocated SrcSpan a -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="#local-6989586621681149383"><span class="hs-identifier hs-var">top_level_err</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;bindings for unlifted types&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149387"><span class="hs-identifier hs-var">unlifted_binds</span></a></span><span>
</span><span id="line-94"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsBind GhcTc)
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) ())
-&gt; LHsBinds GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; Bag a -&gt; m ()
</span><a href="GHC.Data.Bag.html#mapBagM_"><span class="hs-identifier hs-var">mapBagM_</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
-&gt; GenLocated SrcSpan (HsBind GhcTc)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall {a}.
Outputable a =&gt;
String -&gt; GenLocated SrcSpan a -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="#local-6989586621681149383"><span class="hs-identifier hs-var">top_level_err</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;strict bindings&quot;</span></span><span class="hs-special">)</span><span>             </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149385"><span class="hs-identifier hs-var">bang_binds</span></a></span><span>
</span><span id="line-95"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr) -&gt; DsM (OrdList (EvVar, CoreExpr))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr)
forall a. OrdList a
</span><a href="GHC.Data.OrdList.html#nilOL"><span class="hs-identifier hs-var">nilOL</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-98"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149381"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149381"><span class="hs-identifier hs-var">force_vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149380"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149380"><span class="hs-identifier hs-var">prs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsLHsBinds"><span class="hs-identifier hs-var">dsLHsBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149390"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-99"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="GHC.Utils.Misc.html#debugIsOn"><span class="hs-identifier hs-var">debugIsOn</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env DsGblEnv DsLclEnv) ()
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) ())
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-100"></span><span>         </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149377"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149377"><span class="hs-identifier hs-var">xstrict</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; TcRnIf DsGblEnv DsLclEnv Bool
forall gbl lcl. Extension -&gt; TcRnIf gbl lcl Bool
</span><a href="GHC.Tc.Utils.Monad.html#xoptM"><span class="hs-identifier hs-var">xoptM</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#Strict"><span class="hs-identifier hs-var">LangExt.Strict</span></a></span><span>
</span><span id="line-101"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="hs-identifier">MASSERT2</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">force_vars</span><span> </span><span class="hs-operator">||</span><span> </span><span class="hs-identifier">xstrict</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">binds</span><span> </span><span class="hs-operator">$$</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">force_vars</span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-102"></span><span>              </span><span class="hs-comment">-- with -XStrict, even top-level vars are listed as force vars.</span><span>
</span><span id="line-103"></span><span>
</span><span id="line-104"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr) -&gt; DsM (OrdList (EvVar, CoreExpr))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)] -&gt; OrdList (EvVar, CoreExpr)
forall a. [a] -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#toOL"><span class="hs-identifier hs-var">toOL</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149380"><span class="hs-identifier hs-var">prs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-105"></span><span>
</span><span id="line-106"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-107"></span><span>    </span><span id="local-6989586621681149387"><span class="annot"><span class="annottext">unlifted_binds :: LHsBinds GhcTc
</span><a href="#local-6989586621681149387"><span class="hs-identifier hs-var hs-var">unlifted_binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsBind GhcTc) -&gt; Bool)
-&gt; LHsBinds GhcTc -&gt; LHsBinds GhcTc
forall a. (a -&gt; Bool) -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#filterBag"><span class="hs-identifier hs-var">filterBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBind GhcTc -&gt; Bool
</span><a href="GHC.Hs.Utils.html#isUnliftedHsBind"><span class="hs-identifier hs-var">isUnliftedHsBind</span></a></span><span> </span><span class="annot"><span class="annottext">(HsBind GhcTc -&gt; Bool)
-&gt; (GenLocated SrcSpan (HsBind GhcTc) -&gt; HsBind GhcTc)
-&gt; GenLocated SrcSpan (HsBind GhcTc)
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBind GhcTc) -&gt; HsBind GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149390"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-108"></span><span>    </span><span id="local-6989586621681149385"><span class="annot"><span class="annottext">bang_binds :: LHsBinds GhcTc
</span><a href="#local-6989586621681149385"><span class="hs-identifier hs-var hs-var">bang_binds</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsBind GhcTc) -&gt; Bool)
-&gt; LHsBinds GhcTc -&gt; LHsBinds GhcTc
forall a. (a -&gt; Bool) -&gt; Bag a -&gt; Bag a
</span><a href="GHC.Data.Bag.html#filterBag"><span class="hs-identifier hs-var">filterBag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsBind GhcTc -&gt; Bool
</span><a href="GHC.Hs.Utils.html#isBangedHsBind"><span class="hs-identifier hs-var">isBangedHsBind</span></a></span><span>   </span><span class="annot"><span class="annottext">(HsBind GhcTc -&gt; Bool)
-&gt; (GenLocated SrcSpan (HsBind GhcTc) -&gt; HsBind GhcTc)
-&gt; GenLocated SrcSpan (HsBind GhcTc)
-&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBind GhcTc) -&gt; HsBind GhcTc
forall l e. GenLocated l e -&gt; e
</span><a href="GHC.Types.SrcLoc.html#unLoc"><span class="hs-identifier hs-var">unLoc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149390"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-109"></span><span>
</span><span id="line-110"></span><span>    </span><span id="local-6989586621681149383"><span class="annot"><span class="annottext">top_level_err :: String -&gt; GenLocated SrcSpan a -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="#local-6989586621681149383"><span class="hs-identifier hs-var hs-var">top_level_err</span></a></span></span><span> </span><span id="local-6989586621681149361"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681149361"><span class="hs-identifier hs-var">desc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681149359"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149359"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681149358"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681149358"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-111"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149359"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env DsGblEnv DsLclEnv) ()
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) ())
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-112"></span><span>        </span><span class="annot"><span class="annottext">SDoc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="GHC.HsToCore.Monad.html#errDs"><span class="hs-identifier hs-var">errDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SDoc -&gt; Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Top-level&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681149361"><span class="hs-identifier hs-var">desc</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;aren't allowed:&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-113"></span><span>                  </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681149358"><span class="hs-identifier hs-var">bind</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-114"></span><span>
</span><span id="line-115"></span><span>
</span><span id="line-116"></span><span class="hs-comment">-- | Desugar all other kind of bindings, Ids of strict binds are returned to</span><span>
</span><span id="line-117"></span><span class="hs-comment">-- later be forced in the binding group body, see Note [Desugar Strict binds]</span><span>
</span><span id="line-118"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsLHsBinds"><span class="hs-identifier hs-type">dsLHsBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBinds"><span class="hs-identifier hs-type">LHsBinds</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-119"></span><span id="dsLHsBinds"><span class="annot"><span class="annottext">dsLHsBinds :: LHsBinds GhcTc -&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsLHsBinds"><span class="hs-identifier hs-var hs-var">dsLHsBinds</span></a></span></span><span> </span><span id="local-6989586621681149352"><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149352"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-120"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149351"><span class="annot"><span class="annottext">Bag ([EvVar], [(EvVar, CoreExpr)])
</span><a href="#local-6989586621681149351"><span class="hs-identifier hs-var">ds_bs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(GenLocated SrcSpan (HsBind GhcTc)
 -&gt; DsM ([EvVar], [(EvVar, CoreExpr)]))
-&gt; LHsBinds GhcTc
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv) (Bag ([EvVar], [(EvVar, CoreExpr)]))
forall (m :: * -&gt; *) a b.
Monad m =&gt;
(a -&gt; m b) -&gt; Bag a -&gt; m (Bag b)
</span><a href="GHC.Data.Bag.html#mapBagM"><span class="hs-identifier hs-var">mapBagM</span></a></span><span> </span><span class="annot"><span class="annottext">GenLocated SrcSpan (HsBind GhcTc)
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsLHsBind"><span class="hs-identifier hs-var">dsLHsBind</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149352"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-121"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(([EvVar], [(EvVar, CoreExpr)])
 -&gt; ([EvVar], [(EvVar, CoreExpr)])
 -&gt; ([EvVar], [(EvVar, CoreExpr)]))
-&gt; (([EvVar], [(EvVar, CoreExpr)])
    -&gt; ([EvVar], [(EvVar, CoreExpr)]))
-&gt; ([EvVar], [(EvVar, CoreExpr)])
-&gt; Bag ([EvVar], [(EvVar, CoreExpr)])
-&gt; ([EvVar], [(EvVar, CoreExpr)])
forall r a. (r -&gt; r -&gt; r) -&gt; (a -&gt; r) -&gt; r -&gt; Bag a -&gt; r
</span><a href="GHC.Data.Bag.html#foldBag"><span class="hs-identifier hs-var">foldBag</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681149347"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149347"><span class="hs-identifier hs-var">a</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149346"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149346"><span class="hs-identifier hs-var">a'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149345"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149345"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149344"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149344"><span class="hs-identifier hs-var">b'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149347"><span class="hs-identifier hs-var">a</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; [EvVar] -&gt; [EvVar]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149345"><span class="hs-identifier hs-var">b</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149346"><span class="hs-identifier hs-var">a'</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149344"><span class="hs-identifier hs-var">b'</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-122"></span><span>                         </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)]) -&gt; ([EvVar], [(EvVar, CoreExpr)])
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bag ([EvVar], [(EvVar, CoreExpr)])
</span><a href="#local-6989586621681149351"><span class="hs-identifier hs-var">ds_bs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-123"></span><span>
</span><span id="line-124"></span><span class="hs-comment">------------------------</span><span>
</span><span id="line-125"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsLHsBind"><span class="hs-identifier hs-type">dsLHsBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#LHsBind"><span class="hs-identifier hs-type">LHsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-126"></span><span>          </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-127"></span><span id="dsLHsBind"><span class="annot"><span class="annottext">dsLHsBind :: GenLocated SrcSpan (HsBind GhcTc)
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsLHsBind"><span class="hs-identifier hs-var hs-var">dsLHsBind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681149341"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149341"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681149340"><span class="annot"><span class="annottext">HsBind GhcTc
</span><a href="#local-6989586621681149340"><span class="hs-identifier hs-var">bind</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681149339"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149339"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-128"></span><span>                            </span><span class="annot"><span class="annottext">SrcSpan
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149341"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(DsM ([EvVar], [(EvVar, CoreExpr)])
 -&gt; DsM ([EvVar], [(EvVar, CoreExpr)]))
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; HsBind GhcTc -&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsHsBind"><span class="hs-identifier hs-var">dsHsBind</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149339"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HsBind GhcTc
</span><a href="#local-6989586621681149340"><span class="hs-identifier hs-var">bind</span></a></span><span>
</span><span id="line-129"></span><span>
</span><span id="line-130"></span><span class="hs-comment">-- | Desugar a single binding (or group of recursive binds).</span><span>
</span><span id="line-131"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsBind"><span class="hs-identifier hs-type">dsHsBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-132"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#HsBind"><span class="hs-identifier hs-type">HsBind</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span>
</span><span id="line-133"></span><span>         </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>         </span><span class="hs-comment">-- ^ The Ids of strict binds, to be forced in the body of the</span><span>
</span><span id="line-135"></span><span>         </span><span class="hs-comment">-- binding group see Note [Desugar Strict binds] and all</span><span>
</span><span id="line-136"></span><span>         </span><span class="hs-comment">-- bindings and their desugared right hand sides.</span><span>
</span><span id="line-137"></span><span>
</span><span id="line-138"></span><span id="dsHsBind"><span class="annot"><span class="annottext">dsHsBind :: DynFlags -&gt; HsBind GhcTc -&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsHsBind"><span class="hs-identifier hs-var hs-var">dsHsBind</span></a></span></span><span> </span><span id="local-6989586621681149336"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149336"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#VarBind"><span class="hs-identifier hs-type">VarBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">var_id :: forall idL idR. HsBindLR idL idR -&gt; IdP idL
</span><a href="GHC.Hs.Binds.html#var_id"><span class="hs-identifier hs-var">var_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149333"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149333"><span class="hs-identifier hs-var">var</span></a></span></span><span>
</span><span id="line-139"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">var_rhs :: forall idL idR. HsBindLR idL idR -&gt; LHsExpr idR
</span><a href="GHC.Hs.Binds.html#var_rhs"><span class="hs-identifier hs-var">var_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149331"><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149331"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-140"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149330"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149330"><span class="hs-identifier hs-var">core_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Expr.html#dsLExpr"><span class="hs-identifier hs-var">dsLExpr</span></a></span><span> </span><span class="annot"><span class="annottext">LHsExpr GhcTc
</span><a href="#local-6989586621681149331"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-141"></span><span>                </span><span class="hs-comment">-- Dictionary bindings are always VarBinds,</span><span>
</span><span id="line-142"></span><span>                </span><span class="hs-comment">-- so we only need do this here</span><span>
</span><span id="line-143"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149329"><span class="annot"><span class="annottext">core_bind :: (EvVar, CoreExpr)
</span><a href="#local-6989586621681149329"><span class="hs-identifier hs-var">core_bind</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681149328"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149328"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; EvVar -&gt; Bool -&gt; Arity -&gt; CoreExpr -&gt; (EvVar, CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#makeCorePair"><span class="hs-identifier hs-var">makeCorePair</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149336"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149333"><span class="hs-identifier hs-var">var</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149330"><span class="hs-identifier hs-var">core_expr</span></a></span><span>
</span><span id="line-144"></span><span>              </span><span id="local-6989586621681149326"><span class="annot"><span class="annottext">force_var :: [EvVar]
</span><a href="#local-6989586621681149326"><span class="hs-identifier hs-var hs-var">force_var</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#xopt"><span class="hs-identifier hs-var">xopt</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#Strict"><span class="hs-identifier hs-var">LangExt.Strict</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149336"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-145"></span><span>                          </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149328"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-146"></span><span>                          </span><span class="hs-keyword">else</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-147"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149326"><span class="hs-identifier hs-var">force_var</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">(EvVar, CoreExpr)
</span><a href="#local-6989586621681149329"><span class="hs-identifier hs-var">core_bind</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsBind"><span class="hs-identifier hs-var">dsHsBind</span></a></span><span> </span><span id="local-6989586621681149324"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149324"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681149323"><span class="annot"><span class="annottext">b :: HsBind GhcTc
</span><a href="#local-6989586621681149323"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#FunBind"><span class="hs-identifier hs-type">FunBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">fun_id :: forall idL idR. HsBindLR idL idR -&gt; Located (IdP idL)
</span><a href="GHC.Hs.Binds.html#fun_id"><span class="hs-identifier hs-var">fun_id</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681149320"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149320"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span id="local-6989586621681149319"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149319"><span class="hs-identifier hs-var">fun</span></a></span></span><span>
</span><span id="line-150"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_matches :: forall idL idR. HsBindLR idL idR -&gt; MatchGroup idR (LHsExpr idR)
</span><a href="GHC.Hs.Binds.html#fun_matches"><span class="hs-identifier hs-var">fun_matches</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149317"><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681149317"><span class="hs-identifier hs-var">matches</span></a></span></span><span>
</span><span id="line-151"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_ext :: forall idL idR. HsBindLR idL idR -&gt; XFunBind idL idR
</span><a href="GHC.Hs.Binds.html#fun_ext"><span class="hs-identifier hs-var">fun_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149315"><span class="annot"><span class="annottext">XFunBind GhcTc GhcTc
</span><a href="#local-6989586621681149315"><span class="hs-identifier hs-var">co_fn</span></a></span></span><span>
</span><span id="line-152"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">fun_tick :: forall idL idR. HsBindLR idL idR -&gt; [Tickish EvVar]
</span><a href="GHC.Hs.Binds.html#fun_tick"><span class="hs-identifier hs-var">fun_tick</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149313"><span class="annot"><span class="annottext">[Tickish EvVar]
</span><a href="#local-6989586621681149313"><span class="hs-identifier hs-var">tick</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-153"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>   </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149312"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149312"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149311"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149311"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Origin
-&gt; Bag EvVar -&gt; DsM ([EvVar], CoreExpr) -&gt; DsM ([EvVar], CoreExpr)
forall a. Origin -&gt; Bag EvVar -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.PmCheck.html#addTyCsDs"><span class="hs-identifier hs-var">addTyCsDs</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#FromSource"><span class="hs-identifier hs-var">FromSource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HsWrapper -&gt; Bag EvVar
</span><a href="GHC.Tc.Types.Evidence.html#hsWrapDictBinders"><span class="hs-identifier hs-var">hsWrapDictBinders</span></a></span><span> </span><span class="annot"><span class="annottext">XFunBind GhcTc GhcTc
HsWrapper
</span><a href="#local-6989586621681149315"><span class="hs-identifier hs-var">co_fn</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(DsM ([EvVar], CoreExpr) -&gt; DsM ([EvVar], CoreExpr))
-&gt; DsM ([EvVar], CoreExpr) -&gt; DsM ([EvVar], CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-154"></span><span>                          </span><span class="hs-comment">-- FromSource might not be accurate (we don't have any</span><span>
</span><span id="line-155"></span><span>                          </span><span class="hs-comment">-- origin annotations for things in this module), but at</span><span>
</span><span id="line-156"></span><span>                          </span><span class="hs-comment">-- worst we do superfluous calls to the pattern match</span><span>
</span><span id="line-157"></span><span>                          </span><span class="hs-comment">-- oracle.</span><span>
</span><span id="line-158"></span><span>                          </span><span class="hs-comment">-- addTyCsDs: Add type evidence to the refinement type</span><span>
</span><span id="line-159"></span><span>                          </span><span class="hs-comment">--            predicate of the coverage checker</span><span>
</span><span id="line-160"></span><span>                          </span><span class="hs-comment">-- See Note [Type and Term Equality Propagation] in &quot;GHC.HsToCore.PmCheck&quot;</span><span>
</span><span id="line-161"></span><span>                          </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
-&gt; Maybe (LHsExpr GhcTc)
-&gt; MatchGroup GhcTc (LHsExpr GhcTc)
-&gt; DsM ([EvVar], CoreExpr)
</span><a href="GHC.HsToCore.Match.html#matchWrapper"><span class="hs-identifier hs-var">matchWrapper</span></a></span><span>
</span><span id="line-162"></span><span>                           </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LIdP GhcRn -&gt; HsMatchContext GhcRn
forall p. LIdP p -&gt; HsMatchContext p
</span><a href="GHC.Hs.Utils.html#mkPrefixFunRhs"><span class="hs-identifier hs-var">mkPrefixFunRhs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SrcSpan -&gt; Name -&gt; GenLocated SrcSpan Name
forall l e. l -&gt; e -&gt; GenLocated l e
</span><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-var">L</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149320"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149319"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>                           </span><span class="annot"><span class="annottext">Maybe (LHsExpr GhcTc)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681149317"><span class="hs-identifier hs-var">matches</span></a></span><span>
</span><span id="line-164"></span><span>
</span><span id="line-165"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149306"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149306"><span class="hs-identifier hs-var">core_wrap</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">XFunBind GhcTc GhcTc
HsWrapper
</span><a href="#local-6989586621681149315"><span class="hs-identifier hs-var">co_fn</span></a></span><span>
</span><span id="line-166"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149305"><span class="annot"><span class="annottext">body' :: CoreExpr
</span><a href="#local-6989586621681149305"><span class="hs-identifier hs-var hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Tickish EvVar] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkOptTickBox"><span class="hs-identifier hs-var">mkOptTickBox</span></a></span><span> </span><span class="annot"><span class="annottext">[Tickish EvVar]
</span><a href="#local-6989586621681149313"><span class="hs-identifier hs-var">tick</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149311"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-167"></span><span>              </span><span id="local-6989586621681149303"><span class="annot"><span class="annottext">rhs :: CoreExpr
</span><a href="#local-6989586621681149303"><span class="hs-identifier hs-var hs-var">rhs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149306"><span class="hs-identifier hs-var">core_wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149312"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149305"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-168"></span><span>              </span><span id="local-6989586621681149301"><span class="annot"><span class="annottext">core_binds :: (EvVar, CoreExpr)
</span><a href="#local-6989586621681149301"><span class="hs-identifier hs-var">core_binds</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681149300"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149300"><span class="hs-identifier hs-var">id</span></a></span></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; EvVar -&gt; Bool -&gt; Arity -&gt; CoreExpr -&gt; (EvVar, CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#makeCorePair"><span class="hs-identifier hs-var">makeCorePair</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149324"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149319"><span class="hs-identifier hs-var">fun</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149303"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-169"></span><span>              </span><span id="local-6989586621681149299"><span class="annot"><span class="annottext">force_var :: [EvVar]
</span><a href="#local-6989586621681149299"><span class="hs-identifier hs-var hs-var">force_var</span></a></span></span><span>
</span><span id="line-170"></span><span>                  </span><span class="hs-comment">-- Bindings are strict when -XStrict is enabled</span><span>
</span><span id="line-171"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#xopt"><span class="hs-identifier hs-var">xopt</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#Strict"><span class="hs-identifier hs-var">LangExt.Strict</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149324"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-172"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsExpr GhcTc) -&gt; Arity
forall (id :: Pass) body. MatchGroup (GhcPass id) body -&gt; Arity
</span><a href="GHC.Hs.Expr.html#matchGroupArity"><span class="hs-identifier hs-var">matchGroupArity</span></a></span><span> </span><span class="annot"><span class="annottext">MatchGroup GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681149317"><span class="hs-identifier hs-var">matches</span></a></span><span> </span><span class="annot"><span class="annottext">Arity -&gt; Arity -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">0</span></span><span> </span><span class="hs-comment">-- no need to force lambdas</span><span>
</span><span id="line-173"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149300"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-174"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">HsBind GhcTc -&gt; Bool
</span><a href="GHC.Hs.Utils.html#isBangedHsBind"><span class="hs-identifier hs-var">isBangedHsBind</span></a></span><span> </span><span class="annot"><span class="annottext">HsBind GhcTc
</span><a href="#local-6989586621681149323"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-175"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149300"><span class="hs-identifier hs-var">id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-176"></span><span>                </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-177"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-178"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-comment">--pprTrace &quot;dsHsBind&quot; (vcat [ ppr fun &lt;+&gt; ppr (idInlinePragma fun)</span><span>
</span><span id="line-179"></span><span>          </span><span class="hs-comment">--                          , ppr (mg_alts matches)</span><span>
</span><span id="line-180"></span><span>          </span><span class="hs-comment">--                          , ppr args, ppr core_binds, ppr body']) $</span><span>
</span><span id="line-181"></span><span>          </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149299"><span class="hs-identifier hs-var">force_var</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">(EvVar, CoreExpr)
</span><a href="#local-6989586621681149301"><span class="hs-identifier hs-var">core_binds</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-182"></span><span>
</span><span id="line-183"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsBind"><span class="hs-identifier hs-var">dsHsBind</span></a></span><span> </span><span id="local-6989586621681149297"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149297"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatBind"><span class="hs-identifier hs-type">PatBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">pat_lhs :: forall idL idR. HsBindLR idL idR -&gt; LPat idL
</span><a href="GHC.Hs.Binds.html#pat_lhs"><span class="hs-identifier hs-var">pat_lhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149294"><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681149294"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_rhs :: forall idL idR. HsBindLR idL idR -&gt; GRHSs idR (LHsExpr idR)
</span><a href="GHC.Hs.Binds.html#pat_rhs"><span class="hs-identifier hs-var">pat_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149292"><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681149292"><span class="hs-identifier hs-var">grhss</span></a></span></span><span>
</span><span id="line-184"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_ext :: forall idL idR. HsBindLR idL idR -&gt; XPatBind idL idR
</span><a href="GHC.Hs.Binds.html#pat_ext"><span class="hs-identifier hs-var">pat_ext</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#NPatBindTc"><span class="hs-identifier hs-type">NPatBindTc</span></a></span><span> </span><span class="annot"><span class="annottext">NameSet
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681149289"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149289"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-185"></span><span>                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">pat_ticks :: forall idL idR.
HsBindLR idL idR -&gt; ([Tickish EvVar], [[Tickish EvVar]])
</span><a href="GHC.Hs.Binds.html#pat_ticks"><span class="hs-identifier hs-var">pat_ticks</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149287"><span class="annot"><span class="annottext">[Tickish EvVar]
</span><a href="#local-6989586621681149287"><span class="hs-identifier hs-var">rhs_tick</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149286"><span class="annot"><span class="annottext">[[Tickish EvVar]]
</span><a href="#local-6989586621681149286"><span class="hs-identifier hs-var">var_ticks</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149285"><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681149285"><span class="hs-identifier hs-var">rhss_deltas</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn -&gt; GRHSs GhcTc (LHsExpr GhcTc) -&gt; DsM [Deltas]
</span><a href="GHC.HsToCore.PmCheck.html#checkGuardMatches"><span class="hs-identifier hs-var">checkGuardMatches</span></a></span><span> </span><span class="annot"><span class="annottext">HsMatchContext GhcRn
forall p. HsMatchContext p
</span><a href="GHC.Hs.Expr.html#PatBindGuards"><span class="hs-identifier hs-var">PatBindGuards</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681149292"><span class="hs-identifier hs-var">grhss</span></a></span><span>
</span><span id="line-187"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149283"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149283"><span class="hs-identifier hs-var">body_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
-&gt; Type -&gt; Maybe (NonEmpty Deltas) -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.GuardedRHSs.html#dsGuarded"><span class="hs-identifier hs-var">dsGuarded</span></a></span><span> </span><span class="annot"><span class="annottext">GRHSs GhcTc (LHsExpr GhcTc)
</span><a href="#local-6989586621681149292"><span class="hs-identifier hs-var">grhss</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149289"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Deltas] -&gt; Maybe (NonEmpty Deltas)
forall a. [a] -&gt; Maybe (NonEmpty a)
</span><a href="../../base/src/Data.List.NonEmpty.html#nonEmpty"><span class="hs-identifier hs-var">nonEmpty</span></a></span><span> </span><span class="annot"><span class="annottext">[Deltas]
</span><a href="#local-6989586621681149285"><span class="hs-identifier hs-var">rhss_deltas</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-188"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149281"><span class="annot"><span class="annottext">body' :: CoreExpr
</span><a href="#local-6989586621681149281"><span class="hs-identifier hs-var hs-var">body'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Tickish EvVar] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkOptTickBox"><span class="hs-identifier hs-var">mkOptTickBox</span></a></span><span> </span><span class="annot"><span class="annottext">[Tickish EvVar]
</span><a href="#local-6989586621681149287"><span class="hs-identifier hs-var">rhs_tick</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149283"><span class="hs-identifier hs-var">body_expr</span></a></span><span>
</span><span id="line-189"></span><span>              </span><span id="local-6989586621681149280"><span class="annot"><span class="annottext">pat' :: LPat GhcTc
</span><a href="#local-6989586621681149280"><span class="hs-identifier hs-var hs-var">pat'</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; LPat GhcTc -&gt; LPat GhcTc
</span><a href="GHC.HsToCore.Utils.html#decideBangHood"><span class="hs-identifier hs-var">decideBangHood</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149297"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681149294"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-190"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149278"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149278"><span class="hs-identifier hs-var">force_var</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681149277"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149277"><span class="hs-identifier hs-var">sel_binds</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[[Tickish EvVar]]
-&gt; LPat GhcTc -&gt; CoreExpr -&gt; DsM (EvVar, [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Utils.html#mkSelectorBinds"><span class="hs-identifier hs-var">mkSelectorBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[[Tickish EvVar]]
</span><a href="#local-6989586621681149286"><span class="hs-identifier hs-var">var_ticks</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681149294"><span class="hs-identifier hs-var">pat</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149281"><span class="hs-identifier hs-var">body'</span></a></span><span>
</span><span id="line-191"></span><span>          </span><span class="hs-comment">-- We silently ignore inline pragmas; no makeCorePair</span><span>
</span><span id="line-192"></span><span>          </span><span class="hs-comment">-- Not so cool, but really doesn't matter</span><span>
</span><span id="line-193"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149275"><span class="annot"><span class="annottext">force_var' :: [EvVar]
</span><a href="#local-6989586621681149275"><span class="hs-identifier hs-var hs-var">force_var'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">LPat GhcTc -&gt; Bool
forall (p :: Pass). LPat (GhcPass p) -&gt; Bool
</span><a href="GHC.Hs.Pat.html#isBangedLPat"><span class="hs-identifier hs-var">isBangedLPat</span></a></span><span> </span><span class="annot"><span class="annottext">LPat GhcTc
</span><a href="#local-6989586621681149280"><span class="hs-identifier hs-var">pat'</span></a></span><span>
</span><span id="line-194"></span><span>                           </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149278"><span class="hs-identifier hs-var">force_var</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-195"></span><span>                           </span><span class="hs-keyword">else</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-196"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149275"><span class="hs-identifier hs-var">force_var'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149277"><span class="hs-identifier hs-var">sel_binds</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-197"></span><span>
</span><span id="line-198"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsBind"><span class="hs-identifier hs-var">dsHsBind</span></a></span><span> </span><span id="local-6989586621681149273"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149273"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#AbsBinds"><span class="hs-identifier hs-type">AbsBinds</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abs_tvs :: forall idL idR. HsBindLR idL idR -&gt; [EvVar]
</span><a href="GHC.Hs.Binds.html#abs_tvs"><span class="hs-identifier hs-var">abs_tvs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149270"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149270"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_ev_vars :: forall idL idR. HsBindLR idL idR -&gt; [EvVar]
</span><a href="GHC.Hs.Binds.html#abs_ev_vars"><span class="hs-identifier hs-var">abs_ev_vars</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149268"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149268"><span class="hs-identifier hs-var">dicts</span></a></span></span><span>
</span><span id="line-199"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_exports :: forall idL idR. HsBindLR idL idR -&gt; [ABExport idL]
</span><a href="GHC.Hs.Binds.html#abs_exports"><span class="hs-identifier hs-var">abs_exports</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149266"><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149266"><span class="hs-identifier hs-var">exports</span></a></span></span><span>
</span><span id="line-200"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_ev_binds :: forall idL idR. HsBindLR idL idR -&gt; [TcEvBinds]
</span><a href="GHC.Hs.Binds.html#abs_ev_binds"><span class="hs-identifier hs-var">abs_ev_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149264"><span class="annot"><span class="annottext">[TcEvBinds]
</span><a href="#local-6989586621681149264"><span class="hs-identifier hs-var">ev_binds</span></a></span></span><span>
</span><span id="line-201"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_binds :: forall idL idR. HsBindLR idL idR -&gt; LHsBinds idL
</span><a href="GHC.Hs.Binds.html#abs_binds"><span class="hs-identifier hs-var">abs_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149262"><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149262"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abs_sig :: forall idL idR. HsBindLR idL idR -&gt; Bool
</span><a href="GHC.Hs.Binds.html#abs_sig"><span class="hs-identifier hs-var">abs_sig</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149260"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149260"><span class="hs-identifier hs-var">has_sig</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-202"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149259"><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
</span><a href="#local-6989586621681149259"><span class="hs-identifier hs-var">ds_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Origin
-&gt; Bag EvVar
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall a. Origin -&gt; Bag EvVar -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.PmCheck.html#addTyCsDs"><span class="hs-identifier hs-var">addTyCsDs</span></a></span><span> </span><span class="annot"><span class="annottext">Origin
</span><a href="GHC.Types.Basic.html#FromSource"><span class="hs-identifier hs-var">FromSource</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar] -&gt; Bag EvVar
forall a. [a] -&gt; Bag a
</span><a href="GHC.Data.Bag.html#listToBag"><span class="hs-identifier hs-var">listToBag</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149268"><span class="hs-identifier hs-var">dicts</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(DsM ([EvVar], [(EvVar, CoreExpr)])
 -&gt; DsM ([EvVar], [(EvVar, CoreExpr)]))
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-203"></span><span>                     </span><span class="annot"><span class="annottext">LHsBinds GhcTc -&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsLHsBinds"><span class="hs-identifier hs-var">dsLHsBinds</span></a></span><span> </span><span class="annot"><span class="annottext">LHsBinds GhcTc
</span><a href="#local-6989586621681149262"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-204"></span><span>             </span><span class="hs-comment">-- addTyCsDs: push type constraints deeper</span><span>
</span><span id="line-205"></span><span>             </span><span class="hs-comment">--            for inner pattern match check</span><span>
</span><span id="line-206"></span><span>             </span><span class="hs-comment">-- See Check, Note [Type and Term Equality Propagation]</span><span>
</span><span id="line-207"></span><span>
</span><span id="line-208"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149257"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681149257"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[TcEvBinds] -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsTcEvBinds_s"><span class="hs-identifier hs-var">dsTcEvBinds_s</span></a></span><span> </span><span class="annot"><span class="annottext">[TcEvBinds]
</span><a href="#local-6989586621681149264"><span class="hs-identifier hs-var">ev_binds</span></a></span><span>
</span><span id="line-209"></span><span>
</span><span id="line-210"></span><span>       </span><span class="hs-comment">-- dsAbsBinds does the hard work</span><span>
</span><span id="line-211"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; [EvVar]
-&gt; [EvVar]
-&gt; [ABExport GhcTc]
-&gt; [CoreBind]
-&gt; ([EvVar], [(EvVar, CoreExpr)])
-&gt; Bool
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsAbsBinds"><span class="hs-identifier hs-var">dsAbsBinds</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149273"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149270"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149268"><span class="hs-identifier hs-var">dicts</span></a></span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149266"><span class="hs-identifier hs-var">exports</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681149257"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span><span> </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
</span><a href="#local-6989586621681149259"><span class="hs-identifier hs-var">ds_binds</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149260"><span class="hs-identifier hs-var">has_sig</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-212"></span><span>
</span><span id="line-213"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsBind"><span class="hs-identifier hs-var">dsHsBind</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#PatSynBind"><span class="hs-identifier hs-type">PatSynBind</span></a></span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsHsBind: PatSynBind&quot;</span></span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="hs-comment">-----------------------</span><span>
</span><span id="line-216"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsAbsBinds"><span class="hs-identifier hs-type">dsAbsBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-217"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#TyVar"><span class="hs-identifier hs-type">TyVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#ABExport"><span class="hs-identifier hs-type">ABExport</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-218"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span>                </span><span class="hs-comment">-- Desugared evidence bindings</span><span>
</span><span id="line-219"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>   </span><span class="hs-comment">-- Desugared value bindings</span><span>
</span><span id="line-220"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>                      </span><span class="hs-comment">-- Single binding with signature</span><span>
</span><span id="line-221"></span><span>           </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span id="dsAbsBinds"><span class="annot"><span class="annottext">dsAbsBinds :: DynFlags
-&gt; [EvVar]
-&gt; [EvVar]
-&gt; [ABExport GhcTc]
-&gt; [CoreBind]
-&gt; ([EvVar], [(EvVar, CoreExpr)])
-&gt; Bool
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
</span><a href="GHC.HsToCore.Binds.html#dsAbsBinds"><span class="hs-identifier hs-var hs-var">dsAbsBinds</span></a></span></span><span> </span><span id="local-6989586621681149252"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149252"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681149251"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149251"><span class="hs-identifier hs-var">tyvars</span></a></span></span><span> </span><span id="local-6989586621681149250"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149250"><span class="hs-identifier hs-var">dicts</span></a></span></span><span> </span><span id="local-6989586621681149249"><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149249"><span class="hs-identifier hs-var">exports</span></a></span></span><span>
</span><span id="line-224"></span><span>           </span><span id="local-6989586621681149248"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681149248"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149247"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149247"><span class="hs-identifier hs-var">force_vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149246"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149246"><span class="hs-identifier hs-var">bind_prs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681149245"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149245"><span class="hs-identifier hs-var">has_sig</span></a></span></span><span>
</span><span id="line-225"></span><span>
</span><span id="line-226"></span><span>    </span><span class="hs-comment">-- A very important common case: one exported variable</span><span>
</span><span id="line-227"></span><span>    </span><span class="hs-comment">-- Non-recursive bindings come through this way</span><span>
</span><span id="line-228"></span><span>    </span><span class="hs-comment">-- So do self-recursive bindings</span><span>
</span><span id="line-229"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">[</span><span id="local-6989586621681149244"><span class="annot"><span class="annottext">ABExport GhcTc
</span><a href="#local-6989586621681149244"><span class="hs-keyword hs-var">export</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149249"><span class="hs-identifier hs-var">exports</span></a></span><span>
</span><span id="line-230"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#ABE"><span class="hs-identifier hs-type">ABE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abe_poly :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_poly"><span class="hs-identifier hs-var">abe_poly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149241"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149241"><span class="hs-identifier hs-var">global_id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_mono :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_mono"><span class="hs-identifier hs-var">abe_mono</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149239"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149239"><span class="hs-identifier hs-var">local_id</span></a></span></span><span>
</span><span id="line-231"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_wrap :: forall p. ABExport p -&gt; HsWrapper
</span><a href="GHC.Hs.Binds.html#abe_wrap"><span class="hs-identifier hs-var">abe_wrap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149237"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149237"><span class="hs-identifier hs-var">wrap</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_prags :: forall p. ABExport p -&gt; TcSpecPrags
</span><a href="GHC.Hs.Binds.html#abe_prags"><span class="hs-identifier hs-var">abe_prags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149235"><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="#local-6989586621681149235"><span class="hs-identifier hs-var">prags</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ABExport GhcTc
</span><a href="#local-6989586621681149244"><span class="hs-keyword hs-var">export</span></a></span><span>
</span><span id="line-232"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681149234"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149234"><span class="hs-identifier hs-var">force_vars'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149247"><span class="hs-identifier hs-var">force_vars</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-233"></span><span>                           </span><span class="hs-special">[</span><span class="hs-special">]</span><span>                  </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; Maybe [EvVar]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-234"></span><span>                           </span><span class="hs-special">[</span><span id="local-6989586621681149233"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149233"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149233"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; EvVar -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149239"><span class="hs-identifier hs-var">local_id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; Maybe [EvVar]
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149241"><span class="hs-identifier hs-var">global_id</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-235"></span><span>                           </span><span class="annot"><span class="annottext">[EvVar]
</span><span class="hs-identifier">_</span></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Maybe [EvVar]
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-236"></span><span>       </span><span class="hs-comment">-- If there is a variable to force, it's just the</span><span>
</span><span id="line-237"></span><span>       </span><span class="hs-comment">-- single variable we are binding here</span><span>
</span><span id="line-238"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149232"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149232"><span class="hs-identifier hs-var">core_wrap</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149237"><span class="hs-identifier hs-var">wrap</span></a></span><span> </span><span class="hs-comment">-- Usually the identity</span><span>
</span><span id="line-239"></span><span>
</span><span id="line-240"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149231"><span class="annot"><span class="annottext">rhs :: CoreExpr
</span><a href="#local-6989586621681149231"><span class="hs-identifier hs-var hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149232"><span class="hs-identifier hs-var">core_wrap</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-241"></span><span>                   </span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149251"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149250"><span class="hs-identifier hs-var">dicts</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-242"></span><span>                   </span><span class="annot"><span class="annottext">[CoreBind] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLets"><span class="hs-identifier hs-var">mkCoreLets</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681149248"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-243"></span><span>                   </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149229"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-244"></span><span>
</span><span id="line-245"></span><span>             </span><span id="local-6989586621681149229"><span class="annot"><span class="annottext">body :: CoreExpr
</span><a href="#local-6989586621681149229"><span class="hs-identifier hs-var hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149245"><span class="hs-identifier hs-var">has_sig</span></a></span><span>
</span><span id="line-246"></span><span>                  </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149228"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149228"><span class="hs-identifier hs-var">lrhs</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149246"><span class="hs-identifier hs-var">bind_prs</span></a></span><span>
</span><span id="line-247"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149228"><span class="hs-identifier hs-var">lrhs</span></a></span><span>
</span><span id="line-248"></span><span>                  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-249"></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)] -&gt; CoreExpr -&gt; CoreExpr
forall b. [(b, Expr b)] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLetRec"><span class="hs-identifier hs-var">mkLetRec</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149246"><span class="hs-identifier hs-var">bind_prs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149239"><span class="hs-identifier hs-var">local_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-250"></span><span>
</span><span id="line-251"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149225"><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr)
</span><a href="#local-6989586621681149225"><span class="hs-identifier hs-var">spec_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149224"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681149224"><span class="hs-identifier hs-var">rules</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr
-&gt; TcSpecPrags -&gt; DsM (OrdList (EvVar, CoreExpr), [CoreRule])
</span><a href="GHC.HsToCore.Binds.html#dsSpecs"><span class="hs-identifier hs-var">dsSpecs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149231"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="#local-6989586621681149235"><span class="hs-identifier hs-var">prags</span></a></span><span>
</span><span id="line-252"></span><span>
</span><span id="line-253"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149222"><span class="annot"><span class="annottext">global_id' :: EvVar
</span><a href="#local-6989586621681149222"><span class="hs-identifier hs-var hs-var">global_id'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; [CoreRule] -&gt; EvVar
</span><a href="GHC.Core.Rules.html#addIdSpecialisations"><span class="hs-identifier hs-var">addIdSpecialisations</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149241"><span class="hs-identifier hs-var">global_id</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681149224"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-254"></span><span>             </span><span id="local-6989586621681149220"><span class="annot"><span class="annottext">main_bind :: (EvVar, CoreExpr)
</span><a href="#local-6989586621681149220"><span class="hs-identifier hs-var hs-var">main_bind</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; EvVar -&gt; Bool -&gt; Arity -&gt; CoreExpr -&gt; (EvVar, CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#makeCorePair"><span class="hs-identifier hs-var">makeCorePair</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149252"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149222"><span class="hs-identifier hs-var">global_id'</span></a></span><span>
</span><span id="line-255"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcSpecPrags -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isDefaultMethod"><span class="hs-identifier hs-var">isDefaultMethod</span></a></span><span> </span><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="#local-6989586621681149235"><span class="hs-identifier hs-var">prags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-256"></span><span>                                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar] -&gt; Arity
</span><a href="GHC.HsToCore.Binds.html#dictArity"><span class="hs-identifier hs-var">dictArity</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149250"><span class="hs-identifier hs-var">dicts</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149231"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-257"></span><span>
</span><span id="line-258"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149234"><span class="hs-identifier hs-var">force_vars'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">(EvVar, CoreExpr)
</span><a href="#local-6989586621681149220"><span class="hs-identifier hs-var">main_bind</span></a></span><span> </span><span class="annot"><span class="annottext">(EvVar, CoreExpr) -&gt; [(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr) -&gt; [(EvVar, CoreExpr)]
forall a. OrdList a -&gt; [a]
</span><a href="GHC.Data.OrdList.html#fromOL"><span class="hs-identifier hs-var">fromOL</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr)
</span><a href="#local-6989586621681149225"><span class="hs-identifier hs-var">spec_binds</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-259"></span><span>
</span><span id="line-260"></span><span>    </span><span class="hs-comment">-- Another common case: no tyvars, no dicts</span><span>
</span><span id="line-261"></span><span>    </span><span class="hs-comment">-- In this case we can have a much simpler desugaring</span><span>
</span><span id="line-262"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149251"><span class="hs-identifier hs-var">tyvars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149250"><span class="hs-identifier hs-var">dicts</span></a></span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149216"><span class="annot"><span class="annottext">mk_bind :: ABExport GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) (EvVar, CoreExpr)
</span><a href="#local-6989586621681149216"><span class="hs-identifier hs-var hs-var">mk_bind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ABE"><span class="hs-identifier hs-type">ABE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abe_wrap :: forall p. ABExport p -&gt; HsWrapper
</span><a href="GHC.Hs.Binds.html#abe_wrap"><span class="hs-identifier hs-var">abe_wrap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149215"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149215"><span class="hs-identifier hs-var">wrap</span></a></span></span><span>
</span><span id="line-265"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_poly :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_poly"><span class="hs-identifier hs-var">abe_poly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149214"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149214"><span class="hs-identifier hs-var">global</span></a></span></span><span>
</span><span id="line-266"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_mono :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_mono"><span class="hs-identifier hs-var">abe_mono</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149213"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149213"><span class="hs-identifier hs-var">local</span></a></span></span><span>
</span><span id="line-267"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_prags :: forall p. ABExport p -&gt; TcSpecPrags
</span><a href="GHC.Hs.Binds.html#abe_prags"><span class="hs-identifier hs-var">abe_prags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149212"><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="#local-6989586621681149212"><span class="hs-identifier hs-var">prags</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-268"></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149211"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149211"><span class="hs-identifier hs-var">core_wrap</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149215"><span class="hs-identifier hs-var">wrap</span></a></span><span>
</span><span id="line-269"></span><span>                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(EvVar, CoreExpr)
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (EvVar, CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; EvVar -&gt; Bool -&gt; Arity -&gt; CoreExpr -&gt; (EvVar, CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#makeCorePair"><span class="hs-identifier hs-var">makeCorePair</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149252"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149214"><span class="hs-identifier hs-var">global</span></a></span><span>
</span><span id="line-270"></span><span>                                          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcSpecPrags -&gt; Bool
</span><a href="GHC.Hs.Binds.html#isDefaultMethod"><span class="hs-identifier hs-var">isDefaultMethod</span></a></span><span> </span><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="#local-6989586621681149212"><span class="hs-identifier hs-var">prags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-271"></span><span>                                          </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">0</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149211"><span class="hs-identifier hs-var">core_wrap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149213"><span class="hs-identifier hs-var">local</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-272"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149210"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149210"><span class="hs-identifier hs-var">main_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(ABExport GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) (EvVar, CoreExpr))
-&gt; [ABExport GhcTc]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [(EvVar, CoreExpr)]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">ABExport GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) (EvVar, CoreExpr)
</span><a href="#local-6989586621681149216"><span class="hs-identifier hs-var">mk_bind</span></a></span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149249"><span class="hs-identifier hs-var">exports</span></a></span><span>
</span><span id="line-273"></span><span>
</span><span id="line-274"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149247"><span class="hs-identifier hs-var">force_vars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CoreBind] -&gt; [(EvVar, CoreExpr)]
forall b. [Bind b] -&gt; [(b, Expr b)]
</span><a href="GHC.Core.html#flattenBinds"><span class="hs-identifier hs-var">flattenBinds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681149248"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149246"><span class="hs-identifier hs-var">bind_prs</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149210"><span class="hs-identifier hs-var">main_binds</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span>    </span><span class="hs-comment">-- The general case</span><span>
</span><span id="line-277"></span><span>    </span><span class="hs-comment">-- See Note [Desugaring AbsBinds]</span><span>
</span><span id="line-278"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-279"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149207"><span class="annot"><span class="annottext">core_bind :: CoreBind
</span><a href="#local-6989586621681149207"><span class="hs-identifier hs-var hs-var">core_bind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)] -&gt; CoreBind
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; EvVar -&gt; Bool -&gt; Arity -&gt; CoreExpr -&gt; (EvVar, CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#makeCorePair"><span class="hs-identifier hs-var">makeCorePair</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149252"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; EvVar
</span><a href="#local-6989586621681149205"><span class="hs-identifier hs-var">add_inline</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149204"><span class="hs-identifier hs-var">lcl_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149203"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-280"></span><span>                              </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149204"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149204"><span class="hs-identifier hs-var">lcl_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149203"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149203"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149246"><span class="hs-identifier hs-var">bind_prs</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-281"></span><span>                </span><span class="hs-comment">-- Monomorphic recursion possible, hence Rec</span><span>
</span><span id="line-282"></span><span>             </span><span id="local-6989586621681149202"><span class="annot"><span class="annottext">new_force_vars :: [EvVar]
</span><a href="#local-6989586621681149202"><span class="hs-identifier hs-var hs-var">new_force_vars</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; [EvVar]
forall {t :: * -&gt; *}. Foldable t =&gt; t EvVar -&gt; [EvVar]
</span><a href="#local-6989586621681149201"><span class="hs-identifier hs-var">get_new_force_vars</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149247"><span class="hs-identifier hs-var">force_vars</span></a></span><span>
</span><span id="line-283"></span><span>             </span><span id="local-6989586621681149200"><span class="annot"><span class="annottext">locals :: [EvVar]
</span><a href="#local-6989586621681149200"><span class="hs-identifier hs-var hs-var">locals</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ABExport GhcTc -&gt; EvVar) -&gt; [ABExport GhcTc] -&gt; [EvVar]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">ABExport GhcTc -&gt; EvVar
forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_mono"><span class="hs-identifier hs-var hs-var">abe_mono</span></a></span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149249"><span class="hs-identifier hs-var">exports</span></a></span><span>
</span><span id="line-284"></span><span>             </span><span id="local-6989586621681149199"><span class="annot"><span class="annottext">all_locals :: [EvVar]
</span><a href="#local-6989586621681149199"><span class="hs-identifier hs-var hs-var">all_locals</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149200"><span class="hs-identifier hs-var">locals</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; [EvVar] -&gt; [EvVar]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149202"><span class="hs-identifier hs-var">new_force_vars</span></a></span><span>
</span><span id="line-285"></span><span>             </span><span id="local-6989586621681149198"><span class="annot"><span class="annottext">tup_expr :: CoreExpr
</span><a href="#local-6989586621681149198"><span class="hs-identifier hs-var hs-var">tup_expr</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkBigCoreVarTup"><span class="hs-identifier hs-var">mkBigCoreVarTup</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149199"><span class="hs-identifier hs-var">all_locals</span></a></span><span>
</span><span id="line-286"></span><span>             </span><span id="local-6989586621681149196"><span class="annot"><span class="annottext">tup_ty :: Type
</span><a href="#local-6989586621681149196"><span class="hs-identifier hs-var hs-var">tup_ty</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149198"><span class="hs-identifier hs-var">tup_expr</span></a></span><span>
</span><span id="line-287"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149194"><span class="annot"><span class="annottext">poly_tup_rhs :: CoreExpr
</span><a href="#local-6989586621681149194"><span class="hs-identifier hs-var hs-var">poly_tup_rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149251"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149250"><span class="hs-identifier hs-var">dicts</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-288"></span><span>                            </span><span class="annot"><span class="annottext">[CoreBind] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLets"><span class="hs-identifier hs-var">mkCoreLets</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681149248"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-289"></span><span>                            </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreExpr -&gt; CoreExpr
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLet"><span class="hs-identifier hs-var">mkLet</span></a></span><span> </span><span class="annot"><span class="annottext">CoreBind
</span><a href="#local-6989586621681149207"><span class="hs-identifier hs-var">core_bind</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-290"></span><span>                            </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149198"><span class="hs-identifier hs-var">tup_expr</span></a></span><span>
</span><span id="line-291"></span><span>
</span><span id="line-292"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149192"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149192"><span class="hs-identifier hs-var">poly_tup_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149194"><span class="hs-identifier hs-var">poly_tup_rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-293"></span><span>
</span><span id="line-294"></span><span>        </span><span class="hs-comment">-- Find corresponding global or make up a new one: sometimes</span><span>
</span><span id="line-295"></span><span>        </span><span class="hs-comment">-- we need to make new export to desugar strict binds, see</span><span>
</span><span id="line-296"></span><span>        </span><span class="hs-comment">-- Note [Desugar Strict binds]</span><span>
</span><span id="line-297"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149189"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149189"><span class="hs-identifier hs-var">exported_force_vars</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149188"><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149188"><span class="hs-identifier hs-var">extra_exports</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; DsM ([EvVar], [ABExport GhcTc])
</span><a href="#local-6989586621681149187"><span class="hs-identifier hs-var">get_exports</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149247"><span class="hs-identifier hs-var">force_vars</span></a></span><span>
</span><span id="line-298"></span><span>
</span><span id="line-299"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149186"><span class="annot"><span class="annottext">mk_bind :: ABExport GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) [(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149186"><span class="hs-identifier hs-var hs-var">mk_bind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#ABE"><span class="hs-identifier hs-type">ABE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abe_wrap :: forall p. ABExport p -&gt; HsWrapper
</span><a href="GHC.Hs.Binds.html#abe_wrap"><span class="hs-identifier hs-var">abe_wrap</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149185"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149185"><span class="hs-identifier hs-var">wrap</span></a></span></span><span>
</span><span id="line-300"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_poly :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_poly"><span class="hs-identifier hs-var">abe_poly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149184"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149184"><span class="hs-identifier hs-var">global</span></a></span></span><span>
</span><span id="line-301"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_mono :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_mono"><span class="hs-identifier hs-var">abe_mono</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149183"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149183"><span class="hs-identifier hs-var">local</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_prags :: forall p. ABExport p -&gt; TcSpecPrags
</span><a href="GHC.Hs.Binds.html#abe_prags"><span class="hs-identifier hs-var">abe_prags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149182"><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="#local-6989586621681149182"><span class="hs-identifier hs-var">spec_prags</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-302"></span><span>                          </span><span class="hs-comment">-- See Note [AbsBinds wrappers] in &quot;GHC.Hs.Binds&quot;</span><span>
</span><span id="line-303"></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149181"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149181"><span class="hs-identifier hs-var">tup_id</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149196"><span class="hs-identifier hs-var">tup_ty</span></a></span><span>
</span><span id="line-304"></span><span>                     </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149180"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149180"><span class="hs-identifier hs-var">core_wrap</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149185"><span class="hs-identifier hs-var">wrap</span></a></span><span>
</span><span id="line-305"></span><span>                     </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149179"><span class="annot"><span class="annottext">rhs :: CoreExpr
</span><a href="#local-6989586621681149179"><span class="hs-identifier hs-var hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149180"><span class="hs-identifier hs-var">core_wrap</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149251"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149250"><span class="hs-identifier hs-var">dicts</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-306"></span><span>                                 </span><span class="annot"><span class="annottext">[EvVar] -&gt; EvVar -&gt; EvVar -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkTupleSelector"><span class="hs-identifier hs-var">mkTupleSelector</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149199"><span class="hs-identifier hs-var">all_locals</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149183"><span class="hs-identifier hs-var">local</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149181"><span class="hs-identifier hs-var">tup_id</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-307"></span><span>                                 </span><span class="annot"><span class="annottext">CoreExpr -&gt; [EvVar] -&gt; CoreExpr
forall b. Expr b -&gt; [EvVar] -&gt; Expr b
</span><a href="GHC.Core.html#mkVarApps"><span class="hs-identifier hs-var">mkVarApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149192"><span class="hs-identifier hs-var">poly_tup_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149251"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; [EvVar] -&gt; [EvVar]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149250"><span class="hs-identifier hs-var">dicts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-308"></span><span>                           </span><span id="local-6989586621681149176"><span class="annot"><span class="annottext">rhs_for_spec :: CoreExpr
</span><a href="#local-6989586621681149176"><span class="hs-identifier hs-var hs-var">rhs_for_spec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreExpr -&gt; CoreExpr
forall b. Bind b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Let"><span class="hs-identifier hs-var">Let</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149192"><span class="hs-identifier hs-var">poly_tup_id</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149194"><span class="hs-identifier hs-var">poly_tup_rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149179"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-309"></span><span>                     </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149173"><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr)
</span><a href="#local-6989586621681149173"><span class="hs-identifier hs-var">spec_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149172"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681149172"><span class="hs-identifier hs-var">rules</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr
-&gt; TcSpecPrags -&gt; DsM (OrdList (EvVar, CoreExpr), [CoreRule])
</span><a href="GHC.HsToCore.Binds.html#dsSpecs"><span class="hs-identifier hs-var">dsSpecs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149176"><span class="hs-identifier hs-var">rhs_for_spec</span></a></span><span> </span><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="#local-6989586621681149182"><span class="hs-identifier hs-var">spec_prags</span></a></span><span>
</span><span id="line-310"></span><span>                     </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149171"><span class="annot"><span class="annottext">global' :: EvVar
</span><a href="#local-6989586621681149171"><span class="hs-identifier hs-var hs-var">global'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149184"><span class="hs-identifier hs-var">global</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; InlinePragma -&gt; EvVar
</span><a href="GHC.Types.Id.html#setInlinePragma"><span class="hs-operator hs-var">`setInlinePragma`</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="GHC.Types.Basic.html#defaultInlinePragma"><span class="hs-identifier hs-var">defaultInlinePragma</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-311"></span><span>                                             </span><span class="annot"><span class="annottext">EvVar -&gt; [CoreRule] -&gt; EvVar
</span><a href="GHC.Core.Rules.html#addIdSpecialisations"><span class="hs-operator hs-var">`addIdSpecialisations`</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681149172"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-312"></span><span>                           </span><span class="hs-comment">-- Kill the INLINE pragma because it applies to</span><span>
</span><span id="line-313"></span><span>                           </span><span class="hs-comment">-- the user written (local) function.  The global</span><span>
</span><span id="line-314"></span><span>                           </span><span class="hs-comment">-- Id is just the selector.  Hmm.</span><span>
</span><span id="line-315"></span><span>                     </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [(EvVar, CoreExpr)]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149171"><span class="hs-identifier hs-var">global'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149179"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(EvVar, CoreExpr) -&gt; [(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr) -&gt; [(EvVar, CoreExpr)]
forall a. OrdList a -&gt; [a]
</span><a href="GHC.Data.OrdList.html#fromOL"><span class="hs-identifier hs-var">fromOL</span></a></span><span> </span><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr)
</span><a href="#local-6989586621681149173"><span class="hs-identifier hs-var">spec_binds</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-316"></span><span>
</span><span id="line-317"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149168"><span class="annot"><span class="annottext">[[(EvVar, CoreExpr)]]
</span><a href="#local-6989586621681149168"><span class="hs-identifier hs-var">export_binds_s</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(ABExport GhcTc
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) [(EvVar, CoreExpr)])
-&gt; [ABExport GhcTc]
-&gt; IOEnv (Env DsGblEnv DsLclEnv) [[(EvVar, CoreExpr)]]
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Traversable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m (t b)
</span><a href="../../base/src/Data.Traversable.html#mapM"><span class="hs-identifier hs-var">mapM</span></a></span><span> </span><span class="annot"><span class="annottext">ABExport GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) [(EvVar, CoreExpr)]
</span><a href="#local-6989586621681149186"><span class="hs-identifier hs-var">mk_bind</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149249"><span class="hs-identifier hs-var">exports</span></a></span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc] -&gt; [ABExport GhcTc] -&gt; [ABExport GhcTc]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149188"><span class="hs-identifier hs-var">extra_exports</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-318"></span><span>
</span><span id="line-319"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">([EvVar], [(EvVar, CoreExpr)])
-&gt; DsM ([EvVar], [(EvVar, CoreExpr)])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149189"><span class="hs-identifier hs-var">exported_force_vars</span></a></span><span>
</span><span id="line-320"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149192"><span class="hs-identifier hs-var">poly_tup_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149194"><span class="hs-identifier hs-var">poly_tup_rhs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(EvVar, CoreExpr) -&gt; [(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span>
</span><span id="line-321"></span><span>                   </span><span class="annot"><span class="annottext">[[(EvVar, CoreExpr)]] -&gt; [(EvVar, CoreExpr)]
forall (t :: * -&gt; *) a. Foldable t =&gt; t [a] -&gt; [a]
</span><a href="../../base/src/Data.Foldable.html#concat"><span class="hs-identifier hs-var">concat</span></a></span><span> </span><span class="annot"><span class="annottext">[[(EvVar, CoreExpr)]]
</span><a href="#local-6989586621681149168"><span class="hs-identifier hs-var">export_binds_s</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-322"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-323"></span><span>    </span><span class="annot"><a href="#local-6989586621681149166"><span class="hs-identifier hs-type">inline_env</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#IdEnv"><span class="hs-identifier hs-type">IdEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-comment">-- Maps a monomorphic local Id to one with</span><span>
</span><span id="line-324"></span><span>                             </span><span class="hs-comment">-- the inline pragma from the source</span><span>
</span><span id="line-325"></span><span>                             </span><span class="hs-comment">-- The type checker put the inline pragma</span><span>
</span><span id="line-326"></span><span>                             </span><span class="hs-comment">-- on the *global* Id, so we need to transfer it</span><span>
</span><span id="line-327"></span><span>    </span><span id="local-6989586621681149166"><span class="annot"><span class="annottext">inline_env :: IdEnv EvVar
</span><a href="#local-6989586621681149166"><span class="hs-identifier hs-var hs-var">inline_env</span></a></span></span><span>
</span><span id="line-328"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(EvVar, EvVar)] -&gt; IdEnv EvVar
forall a. [(EvVar, a)] -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#mkVarEnv"><span class="hs-identifier hs-var">mkVarEnv</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149164"><span class="hs-identifier hs-var">lcl_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; InlinePragma -&gt; EvVar
</span><a href="GHC.Types.Id.html#setInlinePragma"><span class="hs-identifier hs-var">setInlinePragma</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149164"><span class="hs-identifier hs-var">lcl_id</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149163"><span class="hs-identifier hs-var">prag</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span>                 </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#ABE"><span class="hs-identifier hs-type">ABE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abe_mono :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_mono"><span class="hs-identifier hs-var">abe_mono</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149164"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149164"><span class="hs-identifier hs-var">lcl_id</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_poly :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_poly"><span class="hs-identifier hs-var">abe_poly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149162"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149162"><span class="hs-identifier hs-var">gbl_id</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149249"><span class="hs-identifier hs-var">exports</span></a></span><span>
</span><span id="line-330"></span><span>                 </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149163"><span class="annot"><span class="annottext">prag :: InlinePragma
</span><a href="#local-6989586621681149163"><span class="hs-identifier hs-var hs-var">prag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; InlinePragma
</span><a href="GHC.Types.Id.html#idInlinePragma"><span class="hs-identifier hs-var">idInlinePragma</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149162"><span class="hs-identifier hs-var">gbl_id</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-331"></span><span>
</span><span id="line-332"></span><span>    </span><span class="annot"><a href="#local-6989586621681149205"><span class="hs-identifier hs-type">add_inline</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span>    </span><span class="hs-comment">-- tran</span><span>
</span><span id="line-333"></span><span>    </span><span id="local-6989586621681149205"><span class="annot"><span class="annottext">add_inline :: EvVar -&gt; EvVar
</span><a href="#local-6989586621681149205"><span class="hs-identifier hs-var hs-var">add_inline</span></a></span></span><span> </span><span id="local-6989586621681149160"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149160"><span class="hs-identifier hs-var">lcl_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdEnv EvVar -&gt; EvVar -&gt; Maybe EvVar
forall a. VarEnv a -&gt; EvVar -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">IdEnv EvVar
</span><a href="#local-6989586621681149166"><span class="hs-identifier hs-var">inline_env</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149160"><span class="hs-identifier hs-var">lcl_id</span></a></span><span>
</span><span id="line-334"></span><span>                        </span><span class="annot"><span class="annottext">Maybe EvVar -&gt; EvVar -&gt; EvVar
forall a. Maybe a -&gt; a -&gt; a
</span><a href="GHC.Data.Maybe.html#orElse"><span class="hs-operator hs-var">`orElse`</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149160"><span class="hs-identifier hs-var">lcl_id</span></a></span><span>
</span><span id="line-335"></span><span>
</span><span id="line-336"></span><span>    </span><span class="annot"><a href="#local-6989586621681149157"><span class="hs-identifier hs-type">global_env</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#IdEnv"><span class="hs-identifier hs-type">IdEnv</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-comment">-- Maps local Id to its global exported Id</span><span>
</span><span id="line-337"></span><span>    </span><span id="local-6989586621681149157"><span class="annot"><span class="annottext">global_env :: IdEnv EvVar
</span><a href="#local-6989586621681149157"><span class="hs-identifier hs-var hs-var">global_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-338"></span><span>      </span><span class="annot"><span class="annottext">[(EvVar, EvVar)] -&gt; IdEnv EvVar
forall a. [(EvVar, a)] -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#mkVarEnv"><span class="hs-identifier hs-var">mkVarEnv</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149156"><span class="hs-identifier hs-var">local</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149155"><span class="hs-identifier hs-var">global</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-339"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#ABE"><span class="hs-identifier hs-type">ABE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abe_mono :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_mono"><span class="hs-identifier hs-var">abe_mono</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149156"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149156"><span class="hs-identifier hs-var">local</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_poly :: forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_poly"><span class="hs-identifier hs-var">abe_poly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681149155"><span class="annot"><span class="annottext">IdP GhcTc
</span><a href="#local-6989586621681149155"><span class="hs-identifier hs-var">global</span></a></span></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149249"><span class="hs-identifier hs-var">exports</span></a></span><span>
</span><span id="line-340"></span><span>               </span><span class="hs-special">]</span><span>
</span><span id="line-341"></span><span>
</span><span id="line-342"></span><span>    </span><span class="hs-comment">-- find variables that are not exported</span><span>
</span><span id="line-343"></span><span>    </span><span id="local-6989586621681149201"><span class="annot"><span class="annottext">get_new_force_vars :: t EvVar -&gt; [EvVar]
</span><a href="#local-6989586621681149201"><span class="hs-identifier hs-var hs-var">get_new_force_vars</span></a></span></span><span> </span><span id="local-6989586621681149152"><span class="annot"><span class="annottext">t EvVar
</span><a href="#local-6989586621681149152"><span class="hs-identifier hs-var">lcls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-344"></span><span>      </span><span class="annot"><span class="annottext">(EvVar -&gt; [EvVar] -&gt; [EvVar]) -&gt; [EvVar] -&gt; t EvVar -&gt; [EvVar]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681149150"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149150"><span class="hs-identifier hs-var">lcl</span></a></span></span><span> </span><span id="local-6989586621681149149"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149149"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IdEnv EvVar -&gt; EvVar -&gt; Maybe EvVar
forall a. VarEnv a -&gt; EvVar -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">IdEnv EvVar
</span><a href="#local-6989586621681149157"><span class="hs-identifier hs-var">global_env</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149150"><span class="hs-identifier hs-var">lcl</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-345"></span><span>                           </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149149"><span class="hs-identifier hs-var">acc</span></a></span><span>
</span><span id="line-346"></span><span>                           </span><span class="annot"><span class="annottext">Maybe EvVar
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149150"><span class="hs-identifier hs-var">lcl</span></a></span><span class="annot"><span class="annottext">EvVar -&gt; [EvVar] -&gt; [EvVar]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149149"><span class="hs-identifier hs-var">acc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span>            </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">t EvVar
</span><a href="#local-6989586621681149152"><span class="hs-identifier hs-var">lcls</span></a></span><span>
</span><span id="line-348"></span><span>
</span><span id="line-349"></span><span>    </span><span class="hs-comment">-- find exports or make up new exports for force variables</span><span>
</span><span id="line-350"></span><span>    </span><span class="annot"><a href="#local-6989586621681149187"><span class="hs-identifier hs-type">get_exports</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Hs.Binds.html#ABExport"><span class="hs-identifier hs-type">ABExport</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Extension.html#GhcTc"><span class="hs-identifier hs-type">GhcTc</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-351"></span><span>    </span><span id="local-6989586621681149187"><span class="annot"><span class="annottext">get_exports :: [EvVar] -&gt; DsM ([EvVar], [ABExport GhcTc])
</span><a href="#local-6989586621681149187"><span class="hs-identifier hs-var hs-var">get_exports</span></a></span></span><span> </span><span id="local-6989586621681149148"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149148"><span class="hs-identifier hs-var">lcls</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-352"></span><span>      </span><span class="annot"><span class="annottext">(([EvVar], [ABExport GhcTc])
 -&gt; EvVar -&gt; DsM ([EvVar], [ABExport GhcTc]))
-&gt; ([EvVar], [ABExport GhcTc])
-&gt; [EvVar]
-&gt; DsM ([EvVar], [ABExport GhcTc])
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span class="hs-special">(</span><span id="local-6989586621681149146"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149146"><span class="hs-identifier hs-var">glbls</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149145"><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149145"><span class="hs-identifier hs-var">exports</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681149144"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149144"><span class="hs-identifier hs-var">lcl</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-353"></span><span>              </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">IdEnv EvVar -&gt; EvVar -&gt; Maybe EvVar
forall a. VarEnv a -&gt; EvVar -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">IdEnv EvVar
</span><a href="#local-6989586621681149157"><span class="hs-identifier hs-var">global_env</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149144"><span class="hs-identifier hs-var">lcl</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-354"></span><span>                </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681149143"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149143"><span class="hs-identifier hs-var">glbl</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">([EvVar], [ABExport GhcTc]) -&gt; DsM ([EvVar], [ABExport GhcTc])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149143"><span class="hs-identifier hs-var">glbl</span></a></span><span class="annot"><span class="annottext">EvVar -&gt; [EvVar] -&gt; [EvVar]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149146"><span class="hs-identifier hs-var">glbls</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149145"><span class="hs-identifier hs-var">exports</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>                </span><span class="annot"><span class="annottext">Maybe EvVar
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681149142"><span class="annot"><span class="annottext">ABExport GhcTc
</span><a href="#local-6989586621681149142"><span class="hs-keyword hs-var">export</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; IOEnv (Env DsGblEnv DsLclEnv) (ABExport GhcTc)
</span><a href="#local-6989586621681149141"><span class="hs-identifier hs-var">mk_export</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149144"><span class="hs-identifier hs-var">lcl</span></a></span><span>
</span><span id="line-356"></span><span>                                </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149140"><span class="annot"><span class="annottext">glbl :: IdP GhcTc
</span><a href="#local-6989586621681149140"><span class="hs-identifier hs-var hs-var">glbl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ABExport GhcTc -&gt; IdP GhcTc
forall p. ABExport p -&gt; IdP p
</span><a href="GHC.Hs.Binds.html#abe_poly"><span class="hs-identifier hs-var hs-var">abe_poly</span></a></span><span> </span><span class="annot"><span class="annottext">ABExport GhcTc
</span><a href="#local-6989586621681149142"><span class="hs-keyword hs-var">export</span></a></span><span>
</span><span id="line-357"></span><span>                                </span><span class="annot"><span class="annottext">([EvVar], [ABExport GhcTc]) -&gt; DsM ([EvVar], [ABExport GhcTc])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149140"><span class="hs-identifier hs-var">glbl</span></a></span><span class="annot"><span class="annottext">EvVar -&gt; [EvVar] -&gt; [EvVar]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149146"><span class="hs-identifier hs-var">glbls</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ABExport GhcTc
</span><a href="#local-6989586621681149142"><span class="hs-keyword hs-var">export</span></a></span><span class="annot"><span class="annottext">ABExport GhcTc -&gt; [ABExport GhcTc] -&gt; [ABExport GhcTc]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[ABExport GhcTc]
</span><a href="#local-6989586621681149145"><span class="hs-identifier hs-var">exports</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-358"></span><span>            </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149148"><span class="hs-identifier hs-var">lcls</span></a></span><span>
</span><span id="line-359"></span><span>
</span><span id="line-360"></span><span>    </span><span id="local-6989586621681149141"><span class="annot"><span class="annottext">mk_export :: EvVar -&gt; IOEnv (Env DsGblEnv DsLclEnv) (ABExport GhcTc)
</span><a href="#local-6989586621681149141"><span class="hs-identifier hs-var hs-var">mk_export</span></a></span></span><span> </span><span id="local-6989586621681149139"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149139"><span class="hs-identifier hs-var">local</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-361"></span><span>      </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681149138"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149138"><span class="hs-identifier hs-var">global</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDs"><span class="hs-identifier hs-var">newSysLocalDs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span>
</span><span id="line-362"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149251"><span class="hs-identifier hs-var">tyvars</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149250"><span class="hs-identifier hs-var">dicts</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149139"><span class="hs-identifier hs-var">local</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-363"></span><span>         </span><span class="annot"><span class="annottext">ABExport GhcTc -&gt; IOEnv (Env DsGblEnv DsLclEnv) (ABExport GhcTc)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ABE :: forall p.
XABE p -&gt; IdP p -&gt; IdP p -&gt; HsWrapper -&gt; TcSpecPrags -&gt; ABExport p
</span><a href="GHC.Hs.Binds.html#ABE"><span class="hs-identifier hs-type">ABE</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">abe_ext :: XABE GhcTc
</span><a href="#local-6989586621681149137"><span class="hs-identifier hs-var">abe_ext</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">NoExtField
XABE GhcTc
</span><a href="GHC.Hs.Extension.html#noExtField"><span class="hs-identifier hs-var">noExtField</span></a></span><span>
</span><span id="line-364"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_poly :: IdP GhcTc
</span><a href="GHC.Hs.Binds.html#abe_poly"><span class="hs-identifier hs-var">abe_poly</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149138"><span class="hs-identifier hs-var">global</span></a></span><span>
</span><span id="line-365"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_mono :: IdP GhcTc
</span><a href="GHC.Hs.Binds.html#abe_mono"><span class="hs-identifier hs-var">abe_mono</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar
IdP GhcTc
</span><a href="#local-6989586621681149139"><span class="hs-identifier hs-var">local</span></a></span><span>
</span><span id="line-366"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_wrap :: HsWrapper
</span><a href="GHC.Hs.Binds.html#abe_wrap"><span class="hs-identifier hs-var">abe_wrap</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#WpHole"><span class="hs-identifier hs-var">WpHole</span></a></span><span>
</span><span id="line-367"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">abe_prags :: TcSpecPrags
</span><a href="GHC.Hs.Binds.html#abe_prags"><span class="hs-identifier hs-var">abe_prags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[LTcSpecPrag] -&gt; TcSpecPrags
</span><a href="GHC.Hs.Binds.html#SpecPrags"><span class="hs-identifier hs-var">SpecPrags</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-368"></span><span>
</span><span id="line-369"></span><span class="hs-comment">-- | This is where we apply INLINE and INLINABLE pragmas. All we need to</span><span>
</span><span id="line-370"></span><span class="hs-comment">-- do is to attach the unfolding information to the Id.</span><span>
</span><span id="line-371"></span><span class="hs-comment">--</span><span>
</span><span id="line-372"></span><span class="hs-comment">-- Other decisions about whether to inline are made in</span><span>
</span><span id="line-373"></span><span class="hs-comment">-- `calcUnfoldingGuidance` but the decision about whether to then expose</span><span>
</span><span id="line-374"></span><span class="hs-comment">-- the unfolding in the interface file is made in `GHC.Iface.Tidy.addExternal`</span><span>
</span><span id="line-375"></span><span class="hs-comment">-- using this information.</span><span>
</span><span id="line-376"></span><span class="hs-comment">------------------------</span><span>
</span><span id="line-377"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#makeCorePair"><span class="hs-identifier hs-type">makeCorePair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-378"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-379"></span><span id="makeCorePair"><span class="annot"><span class="annottext">makeCorePair :: DynFlags -&gt; EvVar -&gt; Bool -&gt; Arity -&gt; CoreExpr -&gt; (EvVar, CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#makeCorePair"><span class="hs-identifier hs-var hs-var">makeCorePair</span></a></span></span><span> </span><span id="local-6989586621681149133"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149133"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681149132"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span></span><span> </span><span id="local-6989586621681149131"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149131"><span class="hs-identifier hs-var">is_default_method</span></a></span></span><span> </span><span id="local-6989586621681149130"><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681149130"><span class="hs-identifier hs-var">dict_arity</span></a></span></span><span> </span><span id="local-6989586621681149129"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span></span><span>
</span><span id="line-380"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149131"><span class="hs-identifier hs-var">is_default_method</span></a></span><span>    </span><span class="hs-comment">-- Default methods are *always* inlined</span><span>
</span><span id="line-381"></span><span>                         </span><span class="hs-comment">-- See Note [INLINE and default methods] in GHC.Tc.TyCl.Instance</span><span>
</span><span id="line-382"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Unfolding -&gt; EvVar
</span><a href="GHC.Types.Id.html#setIdUnfolding"><span class="hs-operator hs-var">`setIdUnfolding`</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Unfolding
</span><a href="GHC.Core.Unfold.html#mkCompulsoryUnfolding"><span class="hs-identifier hs-var">mkCompulsoryUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-383"></span><span>
</span><span id="line-384"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-385"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; InlineSpec
</span><a href="GHC.Types.Basic.html#inlinePragmaSpec"><span class="hs-identifier hs-var">inlinePragmaSpec</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149125"><span class="hs-identifier hs-var">inline_prag</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-386"></span><span>          </span><span class="annot"><span class="annottext">InlineSpec
</span><a href="GHC.Types.Basic.html#NoUserInline"><span class="hs-identifier hs-var">NoUserInline</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-387"></span><span>          </span><span class="annot"><span class="annottext">InlineSpec
</span><a href="GHC.Types.Basic.html#NoInline"><span class="hs-identifier hs-var">NoInline</span></a></span><span>     </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-388"></span><span>          </span><span class="annot"><span class="annottext">InlineSpec
</span><a href="GHC.Types.Basic.html#Inlinable"><span class="hs-identifier hs-var">Inlinable</span></a></span><span>    </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Unfolding -&gt; EvVar
</span><a href="GHC.Types.Id.html#setIdUnfolding"><span class="hs-operator hs-var">`setIdUnfolding`</span></a></span><span> </span><span class="annot"><span class="annottext">Unfolding
</span><a href="#local-6989586621681149121"><span class="hs-identifier hs-var">inlinable_unf</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-389"></span><span>          </span><span class="annot"><span class="annottext">InlineSpec
</span><a href="GHC.Types.Basic.html#Inline"><span class="hs-identifier hs-var">Inline</span></a></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(EvVar, CoreExpr)
</span><a href="#local-6989586621681149119"><span class="hs-identifier hs-var">inline_pair</span></a></span><span>
</span><span id="line-390"></span><span>
</span><span id="line-391"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-392"></span><span>    </span><span id="local-6989586621681149125"><span class="annot"><span class="annottext">inline_prag :: InlinePragma
</span><a href="#local-6989586621681149125"><span class="hs-identifier hs-var hs-var">inline_prag</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; InlinePragma
</span><a href="GHC.Types.Id.html#idInlinePragma"><span class="hs-identifier hs-var">idInlinePragma</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span><span>
</span><span id="line-393"></span><span>    </span><span id="local-6989586621681149121"><span class="annot"><span class="annottext">inlinable_unf :: Unfolding
</span><a href="#local-6989586621681149121"><span class="hs-identifier hs-var hs-var">inlinable_unf</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CoreExpr -&gt; Unfolding
</span><a href="GHC.Core.Unfold.html#mkInlinableUnfolding"><span class="hs-identifier hs-var">mkInlinableUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149133"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-394"></span><span>    </span><span id="local-6989586621681149119"><span class="annot"><span class="annottext">inline_pair :: (EvVar, CoreExpr)
</span><a href="#local-6989586621681149119"><span class="hs-identifier hs-var hs-var">inline_pair</span></a></span></span><span>
</span><span id="line-395"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681149117"><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681149117"><span class="hs-identifier hs-var">arity</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; Maybe Arity
</span><a href="GHC.Types.Basic.html#inlinePragmaSat"><span class="hs-identifier hs-var">inlinePragmaSat</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149125"><span class="hs-identifier hs-var">inline_prag</span></a></span><span>
</span><span id="line-396"></span><span>        </span><span class="hs-comment">-- Add an Unfolding for an INLINE (but not for NOINLINE)</span><span>
</span><span id="line-397"></span><span>        </span><span class="hs-comment">-- And eta-expand the RHS; see Note [Eta-expanding INLINE things]</span><span>
</span><span id="line-398"></span><span>       </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149115"><span class="annot"><span class="annottext">real_arity :: Arity
</span><a href="#local-6989586621681149115"><span class="hs-identifier hs-var hs-var">real_arity</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681149130"><span class="hs-identifier hs-var">dict_arity</span></a></span><span> </span><span class="annot"><span class="annottext">Arity -&gt; Arity -&gt; Arity
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681149117"><span class="hs-identifier hs-var">arity</span></a></span><span>
</span><span id="line-399"></span><span>        </span><span class="hs-comment">-- NB: The arity in the InlineRule takes account of the dictionaries</span><span>
</span><span id="line-400"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Unfolding -&gt; EvVar
</span><a href="GHC.Types.Id.html#setIdUnfolding"><span class="hs-operator hs-var">`setIdUnfolding`</span></a></span><span> </span><span class="annot"><span class="annottext">Arity -&gt; CoreExpr -&gt; Unfolding
</span><a href="GHC.Core.Unfold.html#mkInlineUnfoldingWithArity"><span class="hs-identifier hs-var">mkInlineUnfoldingWithArity</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681149115"><span class="hs-identifier hs-var">real_arity</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-401"></span><span>         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Arity -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Opt.Arity.html#etaExpand"><span class="hs-identifier hs-var">etaExpand</span></a></span><span> </span><span class="annot"><span class="annottext">Arity
</span><a href="#local-6989586621681149115"><span class="hs-identifier hs-var">real_arity</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-402"></span><span>
</span><span id="line-403"></span><span>       </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-404"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; (EvVar, CoreExpr) -&gt; (EvVar, CoreExpr)
forall a. String -&gt; SDoc -&gt; a -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprTrace"><span class="hs-identifier hs-var">pprTrace</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;makeCorePair: arity missing&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">((EvVar, CoreExpr) -&gt; (EvVar, CoreExpr))
-&gt; (EvVar, CoreExpr) -&gt; (EvVar, CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-405"></span><span>         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149132"><span class="hs-identifier hs-var">gbl_id</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Unfolding -&gt; EvVar
</span><a href="GHC.Types.Id.html#setIdUnfolding"><span class="hs-operator hs-var">`setIdUnfolding`</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Unfolding
</span><a href="GHC.Core.Unfold.html#mkInlineUnfolding"><span class="hs-identifier hs-var">mkInlineUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149129"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-406"></span><span>
</span><span id="line-407"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dictArity"><span class="hs-identifier hs-type">dictArity</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Arity"><span class="hs-identifier hs-type">Arity</span></a></span><span>
</span><span id="line-408"></span><span class="hs-comment">-- Don't count coercion variables in arity</span><span>
</span><span id="line-409"></span><span id="dictArity"><span class="annot"><span class="annottext">dictArity :: [EvVar] -&gt; Arity
</span><a href="GHC.HsToCore.Binds.html#dictArity"><span class="hs-identifier hs-var hs-var">dictArity</span></a></span></span><span> </span><span id="local-6989586621681149109"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149109"><span class="hs-identifier hs-var">dicts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(EvVar -&gt; Bool) -&gt; [EvVar] -&gt; Arity
forall a. (a -&gt; Bool) -&gt; [a] -&gt; Arity
</span><a href="GHC.Utils.Misc.html#count"><span class="hs-identifier hs-var">count</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Bool
</span><a href="GHC.Types.Var.html#isId"><span class="hs-identifier hs-var">isId</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149109"><span class="hs-identifier hs-var">dicts</span></a></span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span class="hs-comment">{-
Note [Desugaring AbsBinds]
~~~~~~~~~~~~~~~~~~~~~~~~~~
In the general AbsBinds case we desugar the binding to this:

       tup a (d:Num a) = let fm = ...gm...
                             gm = ...fm...
                         in (fm,gm)
       f a d = case tup a d of { (fm,gm) -&gt; fm }
       g a d = case tup a d of { (fm,gm) -&gt; fm }

Note [Rules and inlining]
~~~~~~~~~~~~~~~~~~~~~~~~~
Common special case: no type or dictionary abstraction
This is a bit less trivial than you might suppose
The naive way would be to desugar to something like
        f_lcl = ...f_lcl...     -- The &quot;binds&quot; from AbsBinds
        M.f = f_lcl             -- Generated from &quot;exports&quot;
But we don't want that, because if M.f isn't exported,
it'll be inlined unconditionally at every call site (its rhs is
trivial).  That would be ok unless it has RULES, which would
thereby be completely lost.  Bad, bad, bad.

Instead we want to generate
        M.f = ...f_lcl...
        f_lcl = M.f
Now all is cool. The RULES are attached to M.f (by SimplCore),
and f_lcl is rapidly inlined away.

This does not happen in the same way to polymorphic binds,
because they desugar to
        M.f = /\a. let f_lcl = ...f_lcl... in f_lcl
Although I'm a bit worried about whether full laziness might
float the f_lcl binding out and then inline M.f at its call site

Note [Specialising in no-dict case]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Even if there are no tyvars or dicts, we may have specialisation pragmas.
Class methods can generate
      AbsBinds [] [] [( ... spec-prag]
         { AbsBinds [tvs] [dicts] ...blah }
So the overloading is in the nested AbsBinds. A good example is in GHC.Float:

  class  (Real a, Fractional a) =&gt; RealFrac a  where
    round :: (Integral b) =&gt; a -&gt; b

  instance  RealFrac Float  where
    {-# SPECIALIZE round :: Float -&gt; Int #-}

The top-level AbsBinds for $cround has no tyvars or dicts (because the
instance does not).  But the method is locally overloaded!

Note [Abstracting over tyvars only]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When abstracting over type variable only (not dictionaries), we don't really need to
built a tuple and select from it, as we do in the general case. Instead we can take

        AbsBinds [a,b] [ ([a,b], fg, fl, _),
                         ([b],   gg, gl, _) ]
                { fl = e1
                  gl = e2
                   h = e3 }

and desugar it to

        fg = /\ab. let B in e1
        gg = /\b. let a = () in let B in S(e2)
        h  = /\ab. let B in e3

where B is the *non-recursive* binding
        fl = fg a b
        gl = gg b
        h  = h a b    -- See (b); note shadowing!

Notice (a) g has a different number of type variables to f, so we must
             use the mkArbitraryType thing to fill in the gaps.
             We use a type-let to do that.

         (b) The local variable h isn't in the exports, and rather than
             clone a fresh copy we simply replace h by (h a b), where
             the two h's have different types!  Shadowing happens here,
             which looks confusing but works fine.

         (c) The result is *still* quadratic-sized if there are a lot of
             small bindings.  So if there are more than some small
             number (10), we filter the binding set B by the free
             variables of the particular RHS.  Tiresome.

Why got to this trouble?  It's a common case, and it removes the
quadratic-sized tuple desugaring.  Less clutter, hopefully faster
compilation, especially in a case where there are a *lot* of
bindings.


Note [Eta-expanding INLINE things]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
   foo :: Eq a =&gt; a -&gt; a
   {-# INLINE foo #-}
   foo x = ...

If (foo d) ever gets floated out as a common sub-expression (which can
happen as a result of method sharing), there's a danger that we never
get to do the inlining, which is a Terribly Bad thing given that the
user said &quot;inline&quot;!

To avoid this we pre-emptively eta-expand the definition, so that foo
has the arity with which it is declared in the source code.  In this
example it has arity 2 (one for the Eq and one for x). Doing this
should mean that (foo d) is a PAP and we don't share it.

Note [Nested arities]
~~~~~~~~~~~~~~~~~~~~~
For reasons that are not entirely clear, method bindings come out looking like
this:

  AbsBinds [] [] [$cfromT &lt;= [] fromT]
    $cfromT [InlPrag=INLINE] :: T Bool -&gt; Bool
    { AbsBinds [] [] [fromT &lt;= [] fromT_1]
        fromT :: T Bool -&gt; Bool
        { fromT_1 ((TBool b)) = not b } } }

Note the nested AbsBind.  The arity for the InlineRule on $cfromT should be
gotten from the binding for fromT_1.

It might be better to have just one level of AbsBinds, but that requires more
thought!


Note [Desugar Strict binds]
~~~~~~~~~~~~~~~~~~~~~~~~~~~
See https://gitlab.haskell.org/ghc/ghc/wikis/strict-pragma

Desugaring strict variable bindings looks as follows (core below ==&gt;)

  let !x = rhs
  in  body
==&gt;
  let x = rhs
  in x `seq` body -- seq the variable

and if it is a pattern binding the desugaring looks like

  let !pat = rhs
  in body
==&gt;
  let x = rhs -- bind the rhs to a new variable
      pat = x
  in x `seq` body -- seq the new variable

if there is no variable in the pattern desugaring looks like

  let False = rhs
  in body
==&gt;
  let x = case rhs of {False -&gt; (); _ -&gt; error &quot;Match failed&quot;}
  in x `seq` body

In order to force the Ids in the binding group they are passed around
in the dsHsBind family of functions, and later seq'ed in GHC.HsToCore.Expr.ds_val_bind.

Consider a recursive group like this

  letrec
     f : g = rhs[f,g]
  in &lt;body&gt;

Without `Strict`, we get a translation like this:

  let t = /\a. letrec tm = rhs[fm,gm]
                      fm = case t of fm:_ -&gt; fm
                      gm = case t of _:gm -&gt; gm
                in
                (fm,gm)

  in let f = /\a. case t a of (fm,_) -&gt; fm
  in let g = /\a. case t a of (_,gm) -&gt; gm
  in &lt;body&gt;

Here `tm` is the monomorphic binding for `rhs`.

With `Strict`, we want to force `tm`, but NOT `fm` or `gm`.
Alas, `tm` isn't in scope in the `in &lt;body&gt;` part.

The simplest thing is to return it in the polymorphic
tuple `t`, thus:

  let t = /\a. letrec tm = rhs[fm,gm]
                      fm = case t of fm:_ -&gt; fm
                      gm = case t of _:gm -&gt; gm
                in
                (tm, fm, gm)

  in let f = /\a. case t a of (_,fm,_) -&gt; fm
  in let g = /\a. case t a of (_,_,gm) -&gt; gm
  in let tm = /\a. case t a of (tm,_,_) -&gt; tm
  in tm `seq` &lt;body&gt;


See https://gitlab.haskell.org/ghc/ghc/wikis/strict-pragma for a more
detailed explanation of the desugaring of strict bindings.

Note [Strict binds checks]
~~~~~~~~~~~~~~~~~~~~~~~~~~
There are several checks around properly formed strict bindings. They
all link to this Note. These checks must be here in the desugarer because
we cannot know whether or not a type is unlifted until after zonking, due
to levity polymorphism. These checks all used to be handled in the typechecker
in checkStrictBinds (before Jan '17).

We define an &quot;unlifted bind&quot; to be any bind that binds an unlifted id. Note that

  x :: Char
  (# True, x #) = blah

is *not* an unlifted bind. Unlifted binds are detected by GHC.Hs.Utils.isUnliftedHsBind.

Define a &quot;banged bind&quot; to have a top-level bang. Detected by GHC.Hs.Pat.isBangedHsBind.
Define a &quot;strict bind&quot; to be either an unlifted bind or a banged bind.

The restrictions are:
  1. Strict binds may not be top-level. Checked in dsTopLHsBinds.

  2. Unlifted binds must also be banged. (There is no trouble to compile an unbanged
     unlifted bind, but an unbanged bind looks lazy, and we don't want users to be
     surprised by the strictness of an unlifted bind.) Checked in first clause
     of GHC.HsToCore.Expr.ds_val_bind.

  3. Unlifted binds may not have polymorphism (#6078). (That is, no quantified type
     variables or constraints.) Checked in first clause
     of GHC.HsToCore.Expr.ds_val_bind.

  4. Unlifted binds may not be recursive. Checked in second clause of ds_val_bind.

-}</span><span>
</span><span id="line-646"></span><span>
</span><span id="line-647"></span><span class="hs-comment">------------------------</span><span>
</span><span id="line-648"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsSpecs"><span class="hs-identifier hs-type">dsSpecs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>     </span><span class="hs-comment">-- Its rhs</span><span>
</span><span id="line-649"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#TcSpecPrags"><span class="hs-identifier hs-type">TcSpecPrags</span></a></span><span>
</span><span id="line-650"></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Binding for specialised Ids</span><span>
</span><span id="line-651"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">)</span><span>           </span><span class="hs-comment">-- Rules for the Global Ids</span><span>
</span><span id="line-652"></span><span class="hs-comment">-- See Note [Handling SPECIALISE pragmas] in GHC.Tc.Gen.Bind</span><span>
</span><span id="line-653"></span><span id="dsSpecs"><span class="annot"><span class="annottext">dsSpecs :: CoreExpr
-&gt; TcSpecPrags -&gt; DsM (OrdList (EvVar, CoreExpr), [CoreRule])
</span><a href="GHC.HsToCore.Binds.html#dsSpecs"><span class="hs-identifier hs-var hs-var">dsSpecs</span></a></span></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">TcSpecPrags
</span><a href="GHC.Hs.Binds.html#IsDefaultMethod"><span class="hs-identifier hs-var">IsDefaultMethod</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(OrdList (EvVar, CoreExpr), [CoreRule])
-&gt; DsM (OrdList (EvVar, CoreExpr), [CoreRule])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">OrdList (EvVar, CoreExpr)
forall a. OrdList a
</span><a href="GHC.Data.OrdList.html#nilOL"><span class="hs-identifier hs-var">nilOL</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-654"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsSpecs"><span class="hs-identifier hs-var">dsSpecs</span></a></span><span> </span><span id="local-6989586621681149105"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149105"><span class="hs-identifier hs-var">poly_rhs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecPrags"><span class="hs-identifier hs-type">SpecPrags</span></a></span><span> </span><span id="local-6989586621681149104"><span class="annot"><span class="annottext">[LTcSpecPrag]
</span><a href="#local-6989586621681149104"><span class="hs-identifier hs-var">sps</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-655"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149103"><span class="annot"><span class="annottext">[(OrdList (EvVar, CoreExpr), CoreRule)]
</span><a href="#local-6989586621681149103"><span class="hs-identifier hs-var">pairs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(LTcSpecPrag
 -&gt; IOEnv
      (Env DsGblEnv DsLclEnv)
      (Maybe (OrdList (EvVar, CoreExpr), CoreRule)))
-&gt; [LTcSpecPrag]
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv) [(OrdList (EvVar, CoreExpr), CoreRule)]
forall (m :: * -&gt; *) a b.
Applicative m =&gt;
(a -&gt; m (Maybe b)) -&gt; [a] -&gt; m [b]
</span><a href="GHC.Utils.Monad.html#mapMaybeM"><span class="hs-identifier hs-var">mapMaybeM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Maybe CoreExpr
-&gt; LTcSpecPrag
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
</span><a href="GHC.HsToCore.Binds.html#dsSpec"><span class="hs-identifier hs-var">dsSpec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Maybe CoreExpr
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149105"><span class="hs-identifier hs-var">poly_rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[LTcSpecPrag]
</span><a href="#local-6989586621681149104"><span class="hs-identifier hs-var">sps</span></a></span><span>
</span><span id="line-656"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149101"><span class="annot"><span class="annottext">[OrdList (EvVar, CoreExpr)]
</span><a href="#local-6989586621681149101"><span class="hs-identifier hs-var">spec_binds_s</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149100"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681149100"><span class="hs-identifier hs-var">rules</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(OrdList (EvVar, CoreExpr), CoreRule)]
-&gt; ([OrdList (EvVar, CoreExpr)], [CoreRule])
forall a b. [(a, b)] -&gt; ([a], [b])
</span><a href="../../base/src/GHC.List.html#unzip"><span class="hs-identifier hs-var">unzip</span></a></span><span> </span><span class="annot"><span class="annottext">[(OrdList (EvVar, CoreExpr), CoreRule)]
</span><a href="#local-6989586621681149103"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-657"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(OrdList (EvVar, CoreExpr), [CoreRule])
-&gt; DsM (OrdList (EvVar, CoreExpr), [CoreRule])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[OrdList (EvVar, CoreExpr)] -&gt; OrdList (EvVar, CoreExpr)
forall a. [OrdList a] -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#concatOL"><span class="hs-identifier hs-var">concatOL</span></a></span><span> </span><span class="annot"><span class="annottext">[OrdList (EvVar, CoreExpr)]
</span><a href="#local-6989586621681149101"><span class="hs-identifier hs-var">spec_binds_s</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681149100"><span class="hs-identifier hs-var">rules</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-658"></span><span>
</span><span id="line-659"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsSpec"><span class="hs-identifier hs-type">dsSpec</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>        </span><span class="hs-comment">-- Just rhs =&gt; RULE is for a local binding</span><span>
</span><span id="line-660"></span><span>                                </span><span class="hs-comment">-- Nothing =&gt; RULE is for an imported Id</span><span>
</span><span id="line-661"></span><span>                                </span><span class="hs-comment">--            rhs is in the Id's unfolding</span><span>
</span><span id="line-662"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html#Located"><span class="hs-identifier hs-type">Located</span></a></span><span> </span><span class="annot"><a href="GHC.Hs.Binds.html#TcSpecPrag"><span class="hs-identifier hs-type">TcSpecPrag</span></a></span><span>
</span><span id="line-663"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Data.OrdList.html#OrdList"><span class="hs-identifier hs-type">OrdList</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-664"></span><span id="dsSpec"><span class="annot"><span class="annottext">dsSpec :: Maybe CoreExpr
-&gt; LTcSpecPrag
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
</span><a href="GHC.HsToCore.Binds.html#dsSpec"><span class="hs-identifier hs-var hs-var">dsSpec</span></a></span></span><span> </span><span id="local-6989586621681149097"><span class="annot"><span class="annottext">Maybe CoreExpr
</span><a href="#local-6989586621681149097"><span class="hs-identifier hs-var">mb_poly_rhs</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.SrcLoc.html#L"><span class="hs-identifier hs-type">L</span></a></span><span> </span><span id="local-6989586621681149096"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149096"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Hs.Binds.html#SpecPrag"><span class="hs-identifier hs-type">SpecPrag</span></a></span><span> </span><span id="local-6989586621681149094"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span></span><span> </span><span id="local-6989586621681149093"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149093"><span class="hs-identifier hs-var">spec_co</span></a></span></span><span> </span><span id="local-6989586621681149092"><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149092"><span class="hs-identifier hs-var">spec_inl</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-665"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Maybe Class -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; Maybe Class
</span><a href="GHC.Types.Id.html#isClassOpId_maybe"><span class="hs-identifier hs-var">isClassOpId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-666"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149096"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv
   (Env DsGblEnv DsLclEnv)
   (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
 -&gt; IOEnv
      (Env DsGblEnv DsLclEnv)
      (Maybe (OrdList (EvVar, CoreExpr), CoreRule)))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-667"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ignoring useless SPECIALISE pragma for class method selector&quot;</span></span><span>
</span><span id="line-668"></span><span>                          </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-669"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (OrdList (EvVar, CoreExpr), CoreRule)
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (OrdList (EvVar, CoreExpr), CoreRule)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-special">}</span><span>  </span><span class="hs-comment">-- There is no point in trying to specialise a class op</span><span>
</span><span id="line-670"></span><span>                            </span><span class="hs-comment">-- Moreover, classops don't (currently) have an inl_sat arity set</span><span>
</span><span id="line-671"></span><span>                            </span><span class="hs-comment">-- (it would be Just 0) and that in turn makes makeCorePair bleat</span><span>
</span><span id="line-672"></span><span>
</span><span id="line-673"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149086"><span class="hs-identifier hs-var">no_act_spec</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Activation -&gt; Bool
</span><a href="GHC.Types.Basic.html#isNeverActive"><span class="hs-identifier hs-var">isNeverActive</span></a></span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681149084"><span class="hs-identifier hs-var">rule_act</span></a></span><span>
</span><span id="line-674"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149096"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv
   (Env DsGblEnv DsLclEnv)
   (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
 -&gt; IOEnv
      (Env DsGblEnv DsLclEnv)
      (Maybe (OrdList (EvVar, CoreExpr), CoreRule)))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-675"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Ignoring useless SPECIALISE pragma for NOINLINE function:&quot;</span></span><span>
</span><span id="line-676"></span><span>                          </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-677"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (OrdList (EvVar, CoreExpr), CoreRule)
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (OrdList (EvVar, CoreExpr), CoreRule)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>  </span><span class="hs-special">}</span><span>  </span><span class="hs-comment">-- Function is NOINLINE, and the specialisation inherits that</span><span>
</span><span id="line-678"></span><span>                            </span><span class="hs-comment">-- See Note [Activation pragmas for SPECIALISE]</span><span>
</span><span id="line-679"></span><span>
</span><span id="line-680"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-681"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SrcSpan
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall a. SrcSpan -&gt; DsM a -&gt; DsM a
</span><a href="GHC.HsToCore.Monad.html#putSrcSpanDs"><span class="hs-identifier hs-var">putSrcSpanDs</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681149096"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv
   (Env DsGblEnv DsLclEnv)
   (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
 -&gt; IOEnv
      (Env DsGblEnv DsLclEnv)
      (Maybe (OrdList (EvVar, CoreExpr), CoreRule)))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-682"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149083"><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681149083"><span class="hs-identifier hs-var">uniq</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcRnIf DsGblEnv DsLclEnv Unique
forall gbl lcl. TcRnIf gbl lcl Unique
</span><a href="GHC.Tc.Utils.Monad.html#newUnique"><span class="hs-identifier hs-var">newUnique</span></a></span><span>
</span><span id="line-683"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149081"><span class="annot"><span class="annottext">poly_name :: Name
</span><a href="#local-6989586621681149081"><span class="hs-identifier hs-var hs-var">poly_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span>
</span><span id="line-684"></span><span>             </span><span id="local-6989586621681149080"><span class="annot"><span class="annottext">spec_occ :: OccName
</span><a href="#local-6989586621681149080"><span class="hs-identifier hs-var hs-var">spec_occ</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">OccName -&gt; OccName
</span><a href="GHC.Types.Name.Occurrence.html#mkSpecOcc"><span class="hs-identifier hs-var">mkSpecOcc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; OccName
forall a. NamedThing a =&gt; a -&gt; OccName
</span><a href="GHC.Types.Name.html#getOccName"><span class="hs-identifier hs-var">getOccName</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681149081"><span class="hs-identifier hs-var">poly_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-685"></span><span>             </span><span id="local-6989586621681149077"><span class="annot"><span class="annottext">spec_name :: Name
</span><a href="#local-6989586621681149077"><span class="hs-identifier hs-var hs-var">spec_name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Unique -&gt; OccName -&gt; SrcSpan -&gt; Name
</span><a href="GHC.Types.Name.html#mkInternalName"><span class="hs-identifier hs-var">mkInternalName</span></a></span><span> </span><span class="annot"><span class="annottext">Unique
</span><a href="#local-6989586621681149083"><span class="hs-identifier hs-var">uniq</span></a></span><span> </span><span class="annot"><span class="annottext">OccName
</span><a href="#local-6989586621681149080"><span class="hs-identifier hs-var">spec_occ</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; SrcSpan
forall a. NamedThing a =&gt; a -&gt; SrcSpan
</span><a href="GHC.Types.Name.html#getSrcSpan"><span class="hs-identifier hs-var">getSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681149081"><span class="hs-identifier hs-var">poly_name</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-686"></span><span>             </span><span class="hs-special">(</span><span id="local-6989586621681149074"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149074"><span class="hs-identifier hs-var">spec_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149073"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149073"><span class="hs-identifier hs-var">spec_app</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; ([EvVar], HsWrapper)
</span><a href="GHC.Tc.Types.Evidence.html#collectHsWrapBinders"><span class="hs-identifier hs-var">collectHsWrapBinders</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149093"><span class="hs-identifier hs-var">spec_co</span></a></span><span>
</span><span id="line-687"></span><span>               </span><span class="hs-comment">-- spec_co looks like</span><span>
</span><span id="line-688"></span><span>               </span><span class="hs-comment">--         \spec_bndrs. [] spec_args</span><span>
</span><span id="line-689"></span><span>               </span><span class="hs-comment">-- perhaps with the body of the lambda wrapped in some WpLets</span><span>
</span><span id="line-690"></span><span>               </span><span class="hs-comment">-- E.g. /\a \(d:Eq a). let d2 = $df d in [] (Maybe a) d2</span><span>
</span><span id="line-691"></span><span>
</span><span id="line-692"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149071"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149071"><span class="hs-identifier hs-var">core_app</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681149073"><span class="hs-identifier hs-var">spec_app</span></a></span><span>
</span><span id="line-693"></span><span>
</span><span id="line-694"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149070"><span class="annot"><span class="annottext">ds_lhs :: CoreExpr
</span><a href="#local-6989586621681149070"><span class="hs-identifier hs-var hs-var">ds_lhs</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149071"><span class="hs-identifier hs-var">core_app</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-695"></span><span>             </span><span id="local-6989586621681149069"><span class="annot"><span class="annottext">spec_ty :: Type
</span><a href="#local-6989586621681149069"><span class="hs-identifier hs-var hs-var">spec_ty</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; Type -&gt; Type
</span><a href="GHC.Core.Utils.html#mkLamTypes"><span class="hs-identifier hs-var">mkLamTypes</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149074"><span class="hs-identifier hs-var">spec_bndrs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; Type
</span><a href="GHC.Core.Utils.html#exprType"><span class="hs-identifier hs-var">exprType</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149070"><span class="hs-identifier hs-var">ds_lhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-696"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-comment">-- pprTrace &quot;dsRule&quot; (vcat [ text &quot;Id:&quot; &lt;+&gt; ppr poly_id</span><span>
</span><span id="line-697"></span><span>         </span><span class="hs-comment">--                         , text &quot;spec_co:&quot; &lt;+&gt; ppr spec_co</span><span>
</span><span id="line-698"></span><span>         </span><span class="hs-comment">--                         , text &quot;ds_rhs:&quot; &lt;+&gt; ppr ds_lhs ]) $</span><span>
</span><span id="line-699"></span><span>         </span><span id="local-6989586621681149067"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149067"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-700"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; [EvVar] -&gt; CoreExpr -&gt; Either SDoc ([EvVar], EvVar, [CoreExpr])
</span><a href="GHC.HsToCore.Binds.html#decomposeRuleLhs"><span class="hs-identifier hs-var">decomposeRuleLhs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149067"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149074"><span class="hs-identifier hs-var">spec_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149070"><span class="hs-identifier hs-var">ds_lhs</span></a></span><span> </span><span class="hs-keyword">of</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-701"></span><span>           </span><span class="annot"><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-type">Left</span></a></span><span> </span><span id="local-6989586621681149066"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681149066"><span class="hs-identifier hs-var">msg</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681149066"><span class="hs-identifier hs-var">msg</span></a></span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (OrdList (EvVar, CoreExpr), CoreRule)
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe (OrdList (EvVar, CoreExpr), CoreRule)
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-702"></span><span>           </span><span class="annot"><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-type">Right</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149065"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149065"><span class="hs-identifier hs-var">rule_bndrs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149064"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149064"><span class="hs-identifier hs-var">_fn</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149063"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149063"><span class="hs-identifier hs-var">rule_lhs_args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-703"></span><span>
</span><span id="line-704"></span><span>       </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681149062"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681149062"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) Module
forall (m :: * -&gt; *). HasModule m =&gt; m Module
</span><a href="GHC.Unit.Module.html#getModule"><span class="hs-identifier hs-var">getModule</span></a></span><span>
</span><span id="line-705"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149060"><span class="annot"><span class="annottext">fn_unf :: Unfolding
</span><a href="#local-6989586621681149060"><span class="hs-identifier hs-var hs-var">fn_unf</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Unfolding
</span><a href="GHC.Types.Id.html#realIdUnfolding"><span class="hs-identifier hs-var">realIdUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span>
</span><span id="line-706"></span><span>             </span><span id="local-6989586621681149058"><span class="annot"><span class="annottext">spec_unf :: Unfolding
</span><a href="#local-6989586621681149058"><span class="hs-identifier hs-var hs-var">spec_unf</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; [EvVar]
-&gt; (CoreExpr -&gt; CoreExpr)
-&gt; [CoreExpr]
-&gt; Unfolding
-&gt; Unfolding
</span><a href="GHC.Core.Unfold.html#specUnfolding"><span class="hs-identifier hs-var">specUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149067"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149074"><span class="hs-identifier hs-var">spec_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149071"><span class="hs-identifier hs-var">core_app</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149063"><span class="hs-identifier hs-var">rule_lhs_args</span></a></span><span> </span><span class="annot"><span class="annottext">Unfolding
</span><a href="#local-6989586621681149060"><span class="hs-identifier hs-var">fn_unf</span></a></span><span>
</span><span id="line-707"></span><span>             </span><span id="local-6989586621681149056"><span class="annot"><span class="annottext">spec_id :: EvVar
</span><a href="#local-6989586621681149056"><span class="hs-identifier hs-var hs-var">spec_id</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Type -&gt; Type -&gt; EvVar
Name -&gt; Type -&gt; Type -&gt; EvVar
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681149077"><span class="hs-identifier hs-var">spec_name</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681149069"><span class="hs-identifier hs-var">spec_ty</span></a></span><span> </span><span class="hs-comment">-- Specialised binding is toplevel, hence Many.</span><span>
</span><span id="line-708"></span><span>                            </span><span class="annot"><span class="annottext">EvVar -&gt; InlinePragma -&gt; EvVar
</span><a href="GHC.Types.Id.html#setInlinePragma"><span class="hs-operator hs-var">`setInlinePragma`</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149054"><span class="hs-identifier hs-var">inl_prag</span></a></span><span>
</span><span id="line-709"></span><span>                            </span><span class="annot"><span class="annottext">EvVar -&gt; Unfolding -&gt; EvVar
</span><a href="GHC.Types.Id.html#setIdUnfolding"><span class="hs-operator hs-var">`setIdUnfolding`</span></a></span><span>  </span><span class="annot"><span class="annottext">Unfolding
</span><a href="#local-6989586621681149058"><span class="hs-identifier hs-var">spec_unf</span></a></span><span>
</span><span id="line-710"></span><span>
</span><span id="line-711"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681149053"><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681149053"><span class="hs-identifier hs-var">rule</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Module
-&gt; Bool
-&gt; RuleName
-&gt; Activation
-&gt; Name
-&gt; [EvVar]
-&gt; [CoreExpr]
-&gt; CoreExpr
-&gt; DsM CoreRule
</span><a href="GHC.HsToCore.Binds.html#dsMkUserRule"><span class="hs-identifier hs-var">dsMkUserRule</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681149062"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149052"><span class="hs-identifier hs-var">is_local_id</span></a></span><span>
</span><span id="line-712"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; RuleName
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;SPEC &quot;</span></span><span> </span><span class="annot"><span class="annottext">String -&gt; String -&gt; String
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Name -&gt; String
forall a. Outputable a =&gt; DynFlags -&gt; a -&gt; String
</span><a href="GHC.Utils.Outputable.html#showPpr"><span class="hs-identifier hs-var">showPpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149067"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681149081"><span class="hs-identifier hs-var">poly_name</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-713"></span><span>                        </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681149084"><span class="hs-identifier hs-var">rule_act</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681149081"><span class="hs-identifier hs-var">poly_name</span></a></span><span>
</span><span id="line-714"></span><span>                        </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149065"><span class="hs-identifier hs-var">rule_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149063"><span class="hs-identifier hs-var">rule_lhs_args</span></a></span><span>
</span><span id="line-715"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [EvVar] -&gt; CoreExpr
forall b. Expr b -&gt; [EvVar] -&gt; Expr b
</span><a href="GHC.Core.html#mkVarApps"><span class="hs-identifier hs-var">mkVarApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149056"><span class="hs-identifier hs-var">spec_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149074"><span class="hs-identifier hs-var">spec_bndrs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-716"></span><span>
</span><span id="line-717"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149049"><span class="annot"><span class="annottext">spec_rhs :: CoreExpr
</span><a href="#local-6989586621681149049"><span class="hs-identifier hs-var hs-var">spec_rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149074"><span class="hs-identifier hs-var">spec_bndrs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681149071"><span class="hs-identifier hs-var">core_app</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149048"><span class="hs-identifier hs-var">poly_rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-718"></span><span>
</span><span id="line-719"></span><span class="hs-comment">-- Commented out: see Note [SPECIALISE on INLINE functions]</span><span>
</span><span id="line-720"></span><span class="hs-comment">--       ; when (isInlinePragma id_inl)</span><span>
</span><span id="line-721"></span><span class="hs-comment">--              (warnDs $ text &quot;SPECIALISE pragma on INLINE function probably won't fire:&quot;</span><span>
</span><span id="line-722"></span><span class="hs-comment">--                        &lt;+&gt; quotes (ppr poly_name))</span><span>
</span><span id="line-723"></span><span>
</span><span id="line-724"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">Maybe (OrdList (EvVar, CoreExpr), CoreRule)
-&gt; IOEnv
     (Env DsGblEnv DsLclEnv)
     (Maybe (OrdList (EvVar, CoreExpr), CoreRule))
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(OrdList (EvVar, CoreExpr), CoreRule)
-&gt; Maybe (OrdList (EvVar, CoreExpr), CoreRule)
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(EvVar, CoreExpr) -&gt; OrdList (EvVar, CoreExpr)
forall a. a -&gt; OrdList a
</span><a href="GHC.Data.OrdList.html#unitOL"><span class="hs-identifier hs-var">unitOL</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149056"><span class="hs-identifier hs-var">spec_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149049"><span class="hs-identifier hs-var">spec_rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681149053"><span class="hs-identifier hs-var">rule</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-725"></span><span>            </span><span class="hs-comment">-- NB: do *not* use makeCorePair on (spec_id,spec_rhs), because</span><span>
</span><span id="line-726"></span><span>            </span><span class="hs-comment">--     makeCorePair overwrites the unfolding, which we have</span><span>
</span><span id="line-727"></span><span>            </span><span class="hs-comment">--     just created using specUnfolding</span><span>
</span><span id="line-728"></span><span>       </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-729"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-730"></span><span>    </span><span id="local-6989586621681149052"><span class="annot"><span class="annottext">is_local_id :: Bool
</span><a href="#local-6989586621681149052"><span class="hs-identifier hs-var hs-var">is_local_id</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe CoreExpr -&gt; Bool
forall a. Maybe a -&gt; Bool
</span><a href="../../base/src/Data.Maybe.html#isJust"><span class="hs-identifier hs-var">isJust</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe CoreExpr
</span><a href="#local-6989586621681149097"><span class="hs-identifier hs-var">mb_poly_rhs</span></a></span><span>
</span><span id="line-731"></span><span>    </span><span id="local-6989586621681149048"><span class="annot"><span class="annottext">poly_rhs :: CoreExpr
</span><a href="#local-6989586621681149048"><span class="hs-identifier hs-var hs-var">poly_rhs</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681149046"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149046"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>  </span><span class="annot"><span class="annottext">Maybe CoreExpr
</span><a href="#local-6989586621681149097"><span class="hs-identifier hs-var">mb_poly_rhs</span></a></span><span>
</span><span id="line-732"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149046"><span class="hs-identifier hs-var">rhs</span></a></span><span>          </span><span class="hs-comment">-- Local Id; this is its rhs</span><span>
</span><span id="line-733"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681149045"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149045"><span class="hs-identifier hs-var">unfolding</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Unfolding -&gt; Maybe CoreExpr
</span><a href="GHC.Core.html#maybeUnfoldingTemplate"><span class="hs-identifier hs-var">maybeUnfoldingTemplate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; Unfolding
</span><a href="GHC.Types.Id.html#realIdUnfolding"><span class="hs-identifier hs-var">realIdUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-734"></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149045"><span class="hs-identifier hs-var">unfolding</span></a></span><span>    </span><span class="hs-comment">-- Imported Id; this is its unfolding</span><span>
</span><span id="line-735"></span><span>                            </span><span class="hs-comment">-- Use realIdUnfolding so we get the unfolding</span><span>
</span><span id="line-736"></span><span>                            </span><span class="hs-comment">-- even when it is a loop breaker.</span><span>
</span><span id="line-737"></span><span>                            </span><span class="hs-comment">-- We want to specialise recursive functions!</span><span>
</span><span id="line-738"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; CoreExpr
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsImpSpecs&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-739"></span><span>                            </span><span class="hs-comment">-- The type checker has checked that it *has* an unfolding</span><span>
</span><span id="line-740"></span><span>
</span><span id="line-741"></span><span>    </span><span id="local-6989586621681149042"><span class="annot"><span class="annottext">id_inl :: InlinePragma
</span><a href="#local-6989586621681149042"><span class="hs-identifier hs-var hs-var">id_inl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; InlinePragma
</span><a href="GHC.Types.Id.html#idInlinePragma"><span class="hs-identifier hs-var">idInlinePragma</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span>
</span><span id="line-742"></span><span>
</span><span id="line-743"></span><span>    </span><span class="hs-comment">-- See Note [Activation pragmas for SPECIALISE]</span><span>
</span><span id="line-744"></span><span>    </span><span id="local-6989586621681149054"><span class="annot"><span class="annottext">inl_prag :: InlinePragma
</span><a href="#local-6989586621681149054"><span class="hs-identifier hs-var hs-var">inl_prag</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">InlinePragma -&gt; Bool
</span><a href="GHC.Types.Basic.html#isDefaultInlinePragma"><span class="hs-identifier hs-var">isDefaultInlinePragma</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149092"><span class="hs-identifier hs-var">spec_inl</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149092"><span class="hs-identifier hs-var">spec_inl</span></a></span><span>
</span><span id="line-745"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149052"><span class="hs-identifier hs-var">is_local_id</span></a></span><span>  </span><span class="hs-comment">-- See Note [Specialising imported functions]</span><span>
</span><span id="line-746"></span><span>                                 </span><span class="hs-comment">-- in OccurAnal</span><span>
</span><span id="line-747"></span><span>             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">OccInfo -&gt; Bool
</span><a href="GHC.Types.Basic.html#isStrongLoopBreaker"><span class="hs-identifier hs-var">isStrongLoopBreaker</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; OccInfo
</span><a href="GHC.Types.Id.html#idOccInfo"><span class="hs-identifier hs-var">idOccInfo</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149094"><span class="hs-identifier hs-var">poly_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="GHC.Types.Basic.html#neverInlinePragma"><span class="hs-identifier hs-var">neverInlinePragma</span></a></span><span>
</span><span id="line-748"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149042"><span class="hs-identifier hs-var">id_inl</span></a></span><span>
</span><span id="line-749"></span><span>     </span><span class="hs-comment">-- Get the INLINE pragma from SPECIALISE declaration, or,</span><span>
</span><span id="line-750"></span><span>     </span><span class="hs-comment">-- failing that, from the original Id</span><span>
</span><span id="line-751"></span><span>
</span><span id="line-752"></span><span>    </span><span id="local-6989586621681149037"><span class="annot"><span class="annottext">spec_prag_act :: Activation
</span><a href="#local-6989586621681149037"><span class="hs-identifier hs-var hs-var">spec_prag_act</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; Activation
</span><a href="GHC.Types.Basic.html#inlinePragmaActivation"><span class="hs-identifier hs-var">inlinePragmaActivation</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149092"><span class="hs-identifier hs-var">spec_inl</span></a></span><span>
</span><span id="line-753"></span><span>
</span><span id="line-754"></span><span>    </span><span class="hs-comment">-- See Note [Activation pragmas for SPECIALISE]</span><span>
</span><span id="line-755"></span><span>    </span><span class="hs-comment">-- no_act_spec is True if the user didn't write an explicit</span><span>
</span><span id="line-756"></span><span>    </span><span class="hs-comment">-- phase specification in the SPECIALISE pragma</span><span>
</span><span id="line-757"></span><span>    </span><span id="local-6989586621681149086"><span class="annot"><span class="annottext">no_act_spec :: Bool
</span><a href="#local-6989586621681149086"><span class="hs-identifier hs-var hs-var">no_act_spec</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; InlineSpec
</span><a href="GHC.Types.Basic.html#inlinePragmaSpec"><span class="hs-identifier hs-var">inlinePragmaSpec</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149092"><span class="hs-identifier hs-var">spec_inl</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-758"></span><span>                    </span><span class="annot"><span class="annottext">InlineSpec
</span><a href="GHC.Types.Basic.html#NoInline"><span class="hs-identifier hs-var">NoInline</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Activation -&gt; Bool
</span><a href="GHC.Types.Basic.html#isNeverActive"><span class="hs-identifier hs-var">isNeverActive</span></a></span><span>  </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681149037"><span class="hs-identifier hs-var">spec_prag_act</span></a></span><span>
</span><span id="line-759"></span><span>                    </span><span class="annot"><span class="annottext">InlineSpec
</span><span class="hs-identifier">_</span></span><span>        </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">Activation -&gt; Bool
</span><a href="GHC.Types.Basic.html#isAlwaysActive"><span class="hs-identifier hs-var">isAlwaysActive</span></a></span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681149037"><span class="hs-identifier hs-var">spec_prag_act</span></a></span><span>
</span><span id="line-760"></span><span>    </span><span id="local-6989586621681149084"><span class="annot"><span class="annottext">rule_act :: Activation
</span><a href="#local-6989586621681149084"><span class="hs-identifier hs-var hs-var">rule_act</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149086"><span class="hs-identifier hs-var">no_act_spec</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; Activation
</span><a href="GHC.Types.Basic.html#inlinePragmaActivation"><span class="hs-identifier hs-var">inlinePragmaActivation</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="#local-6989586621681149042"><span class="hs-identifier hs-var">id_inl</span></a></span><span>   </span><span class="hs-comment">-- Inherit</span><span>
</span><span id="line-761"></span><span>             </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681149037"><span class="hs-identifier hs-var">spec_prag_act</span></a></span><span>                   </span><span class="hs-comment">-- Specified by user</span><span>
</span><span id="line-762"></span><span>
</span><span id="line-763"></span><span>
</span><span id="line-764"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsMkUserRule"><span class="hs-identifier hs-type">dsMkUserRule</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Unit.Types.html#Module"><span class="hs-identifier hs-type">Module</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#RuleName"><span class="hs-identifier hs-type">RuleName</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#Activation"><span class="hs-identifier hs-type">Activation</span></a></span><span>
</span><span id="line-765"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Name.html#Name"><span class="hs-identifier hs-type">Name</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBndr"><span class="hs-identifier hs-type">CoreBndr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span>
</span><span id="line-766"></span><span id="dsMkUserRule"><span class="annot"><span class="annottext">dsMkUserRule :: Module
-&gt; Bool
-&gt; RuleName
-&gt; Activation
-&gt; Name
-&gt; [EvVar]
-&gt; [CoreExpr]
-&gt; CoreExpr
-&gt; DsM CoreRule
</span><a href="GHC.HsToCore.Binds.html#dsMkUserRule"><span class="hs-identifier hs-var hs-var">dsMkUserRule</span></a></span></span><span> </span><span id="local-6989586621681149033"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681149033"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span> </span><span id="local-6989586621681149032"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149032"><span class="hs-identifier hs-var">is_local</span></a></span></span><span> </span><span id="local-6989586621681149031"><span class="annot"><span class="annottext">RuleName
</span><a href="#local-6989586621681149031"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681149030"><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681149030"><span class="hs-identifier hs-var">act</span></a></span></span><span> </span><span id="local-6989586621681149029"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681149029"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span id="local-6989586621681149028"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149028"><span class="hs-identifier hs-var">bndrs</span></a></span></span><span> </span><span id="local-6989586621681149027"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149027"><span class="hs-identifier hs-var">args</span></a></span></span><span> </span><span id="local-6989586621681149026"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149026"><span class="hs-identifier hs-var">rhs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-767"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149025"><span class="annot"><span class="annottext">rule :: CoreRule
</span><a href="#local-6989586621681149025"><span class="hs-identifier hs-var hs-var">rule</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
-&gt; Bool
-&gt; Bool
-&gt; RuleName
-&gt; Activation
-&gt; Name
-&gt; [EvVar]
-&gt; [CoreExpr]
-&gt; CoreExpr
-&gt; CoreRule
</span><a href="GHC.Core.Rules.html#mkRule"><span class="hs-identifier hs-var">mkRule</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681149033"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681149032"><span class="hs-identifier hs-var">is_local</span></a></span><span> </span><span class="annot"><span class="annottext">RuleName
</span><a href="#local-6989586621681149031"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Activation
</span><a href="#local-6989586621681149030"><span class="hs-identifier hs-var">act</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681149029"><span class="hs-identifier hs-var">fn</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149028"><span class="hs-identifier hs-var">bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149027"><span class="hs-identifier hs-var">args</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149026"><span class="hs-identifier hs-var">rhs</span></a></span><span>
</span><span id="line-768"></span><span>    </span><span id="local-6989586621681149023"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149023"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-769"></span><span>    </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IsOrphan -&gt; Bool
</span><a href="GHC.Core.html#isOrphan"><span class="hs-identifier hs-var">isOrphan</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreRule -&gt; IsOrphan
</span><a href="GHC.Core.html#ru_orphan"><span class="hs-identifier hs-var hs-var">ru_orphan</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681149025"><span class="hs-identifier hs-var">rule</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">WarningFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#wopt"><span class="hs-identifier hs-var">wopt</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnOrphans"><span class="hs-identifier hs-var">Opt_WarnOrphans</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149023"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env DsGblEnv DsLclEnv) ()
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) ())
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-770"></span><span>        </span><span class="annot"><span class="annottext">WarnReason -&gt; SDoc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="GHC.HsToCore.Monad.html#warnDs"><span class="hs-identifier hs-var">warnDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">WarningFlag -&gt; WarnReason
</span><a href="GHC.Driver.Flags.html#Reason"><span class="hs-identifier hs-var">Reason</span></a></span><span> </span><span class="annot"><span class="annottext">WarningFlag
</span><a href="GHC.Driver.Flags.html#Opt_WarnOrphans"><span class="hs-identifier hs-var">Opt_WarnOrphans</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreRule -&gt; SDoc
</span><a href="GHC.HsToCore.Binds.html#ruleOrphWarn"><span class="hs-identifier hs-var">ruleOrphWarn</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681149025"><span class="hs-identifier hs-var">rule</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-771"></span><span>    </span><span class="annot"><span class="annottext">CoreRule -&gt; DsM CoreRule
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681149025"><span class="hs-identifier hs-var">rule</span></a></span><span>
</span><span id="line-772"></span><span>
</span><span id="line-773"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#ruleOrphWarn"><span class="hs-identifier hs-type">ruleOrphWarn</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span>
</span><span id="line-774"></span><span id="ruleOrphWarn"><span class="annot"><span class="annottext">ruleOrphWarn :: CoreRule -&gt; SDoc
</span><a href="GHC.HsToCore.Binds.html#ruleOrphWarn"><span class="hs-identifier hs-var hs-var">ruleOrphWarn</span></a></span></span><span> </span><span id="local-6989586621681149016"><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681149016"><span class="hs-identifier hs-var">rule</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Orphan rule:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreRule
</span><a href="#local-6989586621681149016"><span class="hs-identifier hs-var">rule</span></a></span><span>
</span><span id="line-775"></span><span>
</span><span id="line-776"></span><span class="hs-comment">{- Note [SPECIALISE on INLINE functions]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We used to warn that using SPECIALISE for a function marked INLINE
would be a no-op; but it isn't!  Especially with worker/wrapper split
we might have
   {-# INLINE f #-}
   f :: Ord a =&gt; Int -&gt; a -&gt; ...
   f d x y = case x of I# x' -&gt; $wf d x' y

We might want to specialise 'f' so that we in turn specialise '$wf'.
We can't even /name/ '$wf' in the source code, so we can't specialise
it even if we wanted to.  #10721 is a case in point.

Note [Activation pragmas for SPECIALISE]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From a user SPECIALISE pragma for f, we generate
  a) A top-level binding    spec_fn = rhs
  b) A RULE                 f dOrd = spec_fn

We need two pragma-like things:

* spec_fn's inline pragma: inherited from f's inline pragma (ignoring
                           activation on SPEC), unless overridden by SPEC INLINE

* Activation of RULE: from SPECIALISE pragma (if activation given)
                      otherwise from f's inline pragma

This is not obvious (see #5237)!

Examples      Rule activation   Inline prag on spec'd fn
---------------------------------------------------------------------
SPEC [n] f :: ty            [n]   Always, or NOINLINE [n]
                                  copy f's prag

NOINLINE f
SPEC [n] f :: ty            [n]   NOINLINE
                                  copy f's prag

NOINLINE [k] f
SPEC [n] f :: ty            [n]   NOINLINE [k]
                                  copy f's prag

INLINE [k] f
SPEC [n] f :: ty            [n]   INLINE [k]
                                  copy f's prag

SPEC INLINE [n] f :: ty     [n]   INLINE [n]
                                  (ignore INLINE prag on f,
                                  same activation for rule and spec'd fn)

NOINLINE [k] f
SPEC f :: ty                [n]   INLINE [k]


************************************************************************
*                                                                      *
\subsection{Adding inline pragmas}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-836"></span><span>
</span><span id="line-837"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#decomposeRuleLhs"><span class="hs-identifier hs-type">decomposeRuleLhs</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-838"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/Data.Either.html#Either"><span class="hs-identifier hs-type">Either</span></a></span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#SDoc"><span class="hs-identifier hs-type">SDoc</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-839"></span><span class="hs-comment">-- (decomposeRuleLhs bndrs lhs) takes apart the LHS of a RULE,</span><span>
</span><span id="line-840"></span><span class="hs-comment">-- The 'bndrs' are the quantified binders of the rules, but decomposeRuleLhs</span><span>
</span><span id="line-841"></span><span class="hs-comment">-- may add some extra dictionary binders (see Note [Free dictionaries])</span><span>
</span><span id="line-842"></span><span class="hs-comment">--</span><span>
</span><span id="line-843"></span><span class="hs-comment">-- Returns an error message if the LHS isn't of the expected shape</span><span>
</span><span id="line-844"></span><span class="hs-comment">-- Note [Decomposing the left-hand side of a RULE]</span><span>
</span><span id="line-845"></span><span id="decomposeRuleLhs"><span class="annot"><span class="annottext">decomposeRuleLhs :: DynFlags
-&gt; [EvVar] -&gt; CoreExpr -&gt; Either SDoc ([EvVar], EvVar, [CoreExpr])
</span><a href="GHC.HsToCore.Binds.html#decomposeRuleLhs"><span class="hs-identifier hs-var hs-var">decomposeRuleLhs</span></a></span></span><span> </span><span id="local-6989586621681149015"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149015"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681149014"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149014"><span class="hs-identifier hs-var">orig_bndrs</span></a></span></span><span> </span><span id="local-6989586621681149013"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149013"><span class="hs-identifier hs-var">orig_lhs</span></a></span></span><span>
</span><span id="line-846"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149012"><span class="hs-identifier hs-var">unbound</span></a></span><span class="hs-special">)</span><span>    </span><span class="hs-comment">-- Check for things unbound on LHS</span><span>
</span><span id="line-847"></span><span>                          </span><span class="hs-comment">-- See Note [Unused spec binders]</span><span>
</span><span id="line-848"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Either SDoc ([EvVar], EvVar, [CoreExpr])
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(EvVar -&gt; SDoc) -&gt; [EvVar] -&gt; [SDoc]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; SDoc
</span><a href="#local-6989586621681149010"><span class="hs-identifier hs-var">dead_msg</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149012"><span class="hs-identifier hs-var">unbound</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-849"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681149009"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149009"><span class="hs-identifier hs-var">funId</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149008"><span class="hs-identifier hs-var">fun2</span></a></span><span>
</span><span id="line-850"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681149007"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681149007"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Maybe DataCon
</span><a href="GHC.Types.Id.html#isDataConId_maybe"><span class="hs-identifier hs-var">isDataConId_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149009"><span class="hs-identifier hs-var">funId</span></a></span><span>
</span><span id="line-851"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Either SDoc ([EvVar], EvVar, [CoreExpr])
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DataCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="#local-6989586621681149005"><span class="hs-identifier hs-var">constructor_msg</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681149007"><span class="hs-identifier hs-var">con</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- See Note [No RULES on datacons]</span><span>
</span><span id="line-852"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681149004"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149004"><span class="hs-identifier hs-var">fn_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681149003"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149003"><span class="hs-identifier hs-var">args</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; Maybe (EvVar, [CoreExpr])
</span><a href="#local-6989586621681149002"><span class="hs-identifier hs-var">decompose</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149008"><span class="hs-identifier hs-var">fun2</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149001"><span class="hs-identifier hs-var">args2</span></a></span><span>
</span><span id="line-853"></span><span>  </span><span class="hs-special">,</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681149000"><span class="annot"><span class="annottext">extra_bndrs :: [EvVar]
</span><a href="#local-6989586621681149000"><span class="hs-identifier hs-var hs-var">extra_bndrs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; [CoreExpr] -&gt; [EvVar]
</span><a href="#local-6989586621681148999"><span class="hs-identifier hs-var">mk_extra_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149004"><span class="hs-identifier hs-var">fn_id</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149003"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-854"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- pprTrace &quot;decmposeRuleLhs&quot; (vcat [ text &quot;orig_bndrs:&quot; &lt;+&gt; ppr orig_bndrs</span><span>
</span><span id="line-855"></span><span>    </span><span class="hs-comment">--                                  , text &quot;orig_lhs:&quot; &lt;+&gt; ppr orig_lhs</span><span>
</span><span id="line-856"></span><span>    </span><span class="hs-comment">--                                  , text &quot;lhs1:&quot;     &lt;+&gt; ppr lhs1</span><span>
</span><span id="line-857"></span><span>    </span><span class="hs-comment">--                                  , text &quot;extra_dict_bndrs:&quot; &lt;+&gt; ppr extra_dict_bndrs</span><span>
</span><span id="line-858"></span><span>    </span><span class="hs-comment">--                                  , text &quot;fn_id:&quot; &lt;+&gt; ppr fn_id</span><span>
</span><span id="line-859"></span><span>    </span><span class="hs-comment">--                                  , text &quot;args:&quot;   &lt;+&gt; ppr args]) $</span><span>
</span><span id="line-860"></span><span>    </span><span class="annot"><span class="annottext">([EvVar], EvVar, [CoreExpr])
-&gt; Either SDoc ([EvVar], EvVar, [CoreExpr])
forall a b. b -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Right"><span class="hs-identifier hs-var">Right</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149014"><span class="hs-identifier hs-var">orig_bndrs</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; [EvVar] -&gt; [EvVar]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149000"><span class="hs-identifier hs-var">extra_bndrs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681149004"><span class="hs-identifier hs-var">fn_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149003"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-861"></span><span>
</span><span id="line-862"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-863"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Either SDoc ([EvVar], EvVar, [CoreExpr])
forall a b. a -&gt; Either a b
</span><a href="../../base/src/Data.Either.html#Left"><span class="hs-identifier hs-var">Left</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681148998"><span class="hs-identifier hs-var">bad_shape_msg</span></a></span><span>
</span><span id="line-864"></span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-865"></span><span>   </span><span id="local-6989586621681148997"><span class="annot"><span class="annottext">lhs1 :: CoreExpr
</span><a href="#local-6989586621681148997"><span class="hs-identifier hs-var hs-var">lhs1</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148996"><span class="hs-identifier hs-var">drop_dicts</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149013"><span class="hs-identifier hs-var">orig_lhs</span></a></span><span>
</span><span id="line-866"></span><span>   </span><span id="local-6989586621681148995"><span class="annot"><span class="annottext">lhs2 :: CoreExpr
</span><a href="#local-6989586621681148995"><span class="hs-identifier hs-var hs-var">lhs2</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; DynFlags -&gt; CoreExpr -&gt; CoreExpr
DynFlags -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.SimpleOpt.html#simpleOptExpr"><span class="hs-identifier hs-var">simpleOptExpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681149015"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148997"><span class="hs-identifier hs-var">lhs1</span></a></span><span>  </span><span class="hs-comment">-- See Note [Simplify rule LHS]</span><span>
</span><span id="line-867"></span><span>   </span><span class="hs-special">(</span><span id="local-6989586621681149008"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149008"><span class="hs-identifier hs-var">fun2</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681149001"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681149001"><span class="hs-identifier hs-var">args2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; (CoreExpr, [CoreExpr])
forall b. Expr b -&gt; (Expr b, [Expr b])
</span><a href="GHC.Core.html#collectArgs"><span class="hs-identifier hs-var">collectArgs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148995"><span class="hs-identifier hs-var">lhs2</span></a></span><span>
</span><span id="line-868"></span><span>
</span><span id="line-869"></span><span>   </span><span id="local-6989586621681148993"><span class="annot"><span class="annottext">lhs_fvs :: VarSet
</span><a href="#local-6989586621681148993"><span class="hs-identifier hs-var hs-var">lhs_fvs</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; VarSet
</span><a href="GHC.Core.FVs.html#exprFreeVars"><span class="hs-identifier hs-var">exprFreeVars</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148995"><span class="hs-identifier hs-var">lhs2</span></a></span><span>
</span><span id="line-870"></span><span>   </span><span id="local-6989586621681149012"><span class="annot"><span class="annottext">unbound :: [EvVar]
</span><a href="#local-6989586621681149012"><span class="hs-identifier hs-var hs-var">unbound</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(EvVar -&gt; Bool) -&gt; [EvVar] -&gt; [EvVar]
forall a. (a -&gt; Bool) -&gt; [a] -&gt; [a]
</span><a href="GHC.Utils.Misc.html#filterOut"><span class="hs-identifier hs-var">filterOut</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148993"><span class="hs-identifier hs-var">lhs_fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149014"><span class="hs-identifier hs-var">orig_bndrs</span></a></span><span>
</span><span id="line-871"></span><span>
</span><span id="line-872"></span><span>   </span><span id="local-6989586621681148989"><span class="annot"><span class="annottext">orig_bndr_set :: VarSet
</span><a href="#local-6989586621681148989"><span class="hs-identifier hs-var hs-var">orig_bndr_set</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149014"><span class="hs-identifier hs-var">orig_bndrs</span></a></span><span>
</span><span id="line-873"></span><span>
</span><span id="line-874"></span><span>        </span><span class="hs-comment">-- Add extra tyvar binders: Note [Free tyvars in rule LHS]</span><span>
</span><span id="line-875"></span><span>        </span><span class="hs-comment">-- and extra dict binders: Note [Free dictionaries in rule LHS]</span><span>
</span><span id="line-876"></span><span>   </span><span id="local-6989586621681148999"><span class="annot"><span class="annottext">mk_extra_bndrs :: EvVar -&gt; [CoreExpr] -&gt; [EvVar]
</span><a href="#local-6989586621681148999"><span class="hs-identifier hs-var hs-var">mk_extra_bndrs</span></a></span></span><span> </span><span id="local-6989586621681148987"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148987"><span class="hs-identifier hs-var">fn_id</span></a></span></span><span> </span><span id="local-6989586621681148986"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681148986"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-877"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; [EvVar]
</span><a href="GHC.Core.TyCo.FVs.html#scopedSort"><span class="hs-identifier hs-var">scopedSort</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681148984"><span class="hs-identifier hs-var">unbound_tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; [EvVar] -&gt; [EvVar]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681148983"><span class="hs-identifier hs-var">unbound_dicts</span></a></span><span>
</span><span id="line-878"></span><span>     </span><span class="hs-keyword">where</span><span>
</span><span id="line-879"></span><span>       </span><span id="local-6989586621681148984"><span class="annot"><span class="annottext">unbound_tvs :: [EvVar]
</span><a href="#local-6989586621681148984"><span class="hs-identifier hs-var hs-var">unbound_tvs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148982"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681148982"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148982"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681148981"><span class="hs-identifier hs-var">unbound_vars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148982"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-880"></span><span>       </span><span id="local-6989586621681148983"><span class="annot"><span class="annottext">unbound_dicts :: [EvVar]
</span><a href="#local-6989586621681148983"><span class="hs-identifier hs-var hs-var">unbound_dicts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Name -&gt; Type -&gt; Type -&gt; EvVar
Name -&gt; Type -&gt; Type -&gt; EvVar
</span><a href="GHC.Types.Id.html#mkLocalId"><span class="hs-identifier hs-var">mkLocalId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Name -&gt; Name
</span><a href="GHC.Types.Name.html#localiseName"><span class="hs-identifier hs-var">localiseName</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148978"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Core.Type.html#Many"><span class="hs-identifier hs-var">Many</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; Type
</span><a href="GHC.Types.Id.html#idType"><span class="hs-identifier hs-var">idType</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148978"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-881"></span><span>                       </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681148978"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148978"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681148981"><span class="hs-identifier hs-var">unbound_vars</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Bool
</span><a href="GHC.Core.Predicate.html#isDictId"><span class="hs-identifier hs-var">isDictId</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148978"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-882"></span><span>       </span><span id="local-6989586621681148981"><span class="annot"><span class="annottext">unbound_vars :: [EvVar]
</span><a href="#local-6989586621681148981"><span class="hs-identifier hs-var hs-var">unbound_vars</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148975"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681148975"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148975"><span class="hs-identifier hs-var">v</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[CoreExpr] -&gt; [EvVar]
</span><a href="GHC.Core.FVs.html#exprsFreeVarsList"><span class="hs-identifier hs-var">exprsFreeVarsList</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681148986"><span class="hs-identifier hs-var">args</span></a></span><span>
</span><span id="line-883"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148975"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148989"><span class="hs-identifier hs-var">orig_bndr_set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-884"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148975"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; EvVar -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148987"><span class="hs-identifier hs-var">fn_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-885"></span><span>         </span><span class="hs-comment">-- fn_id: do not quantify over the function itself, which may</span><span>
</span><span id="line-886"></span><span>         </span><span class="hs-comment">-- itself be a dictionary (in pathological cases, #10251)</span><span>
</span><span id="line-887"></span><span>
</span><span id="line-888"></span><span>   </span><span id="local-6989586621681149002"><span class="annot"><span class="annottext">decompose :: CoreExpr -&gt; [CoreExpr] -&gt; Maybe (EvVar, [CoreExpr])
</span><a href="#local-6989586621681149002"><span class="hs-identifier hs-var hs-var">decompose</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681148973"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148973"><span class="hs-identifier hs-var">fn_id</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681148972"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681148972"><span class="hs-identifier hs-var">args</span></a></span></span><span>
</span><span id="line-889"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148973"><span class="hs-identifier hs-var">fn_id</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148989"><span class="hs-identifier hs-var">orig_bndr_set</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-890"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(EvVar, [CoreExpr]) -&gt; Maybe (EvVar, [CoreExpr])
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148973"><span class="hs-identifier hs-var">fn_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681148972"><span class="hs-identifier hs-var">args</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-891"></span><span>
</span><span id="line-892"></span><span>   </span><span class="annot"><a href="#local-6989586621681149002"><span class="hs-identifier hs-var">decompose</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe (EvVar, [CoreExpr])
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-893"></span><span>
</span><span id="line-894"></span><span>   </span><span id="local-6989586621681148998"><span class="annot"><span class="annottext">bad_shape_msg :: SDoc
</span><a href="#local-6989586621681148998"><span class="hs-identifier hs-var hs-var">bad_shape_msg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RULE left-hand side too complicated to desugar&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-895"></span><span>                      </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Optimised lhs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148995"><span class="hs-identifier hs-var">lhs2</span></a></span><span>
</span><span id="line-896"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Orig lhs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149013"><span class="hs-identifier hs-var">orig_lhs</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-897"></span><span>   </span><span id="local-6989586621681149010"><span class="annot"><span class="annottext">dead_msg :: EvVar -&gt; SDoc
</span><a href="#local-6989586621681149010"><span class="hs-identifier hs-var hs-var">dead_msg</span></a></span></span><span> </span><span id="local-6989586621681148971"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148971"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; Arity -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#hang"><span class="hs-identifier hs-var">hang</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#sep"><span class="hs-identifier hs-var">sep</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Forall'd&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; SDoc
</span><a href="#local-6989586621681148969"><span class="hs-identifier hs-var">pp_bndr</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148971"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-898"></span><span>                             </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;is not bound in RULE lhs&quot;</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-899"></span><span>                      </span><span class="annot"><span class="annottext">Arity
</span><span class="hs-number">2</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Orig bndrs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681149014"><span class="hs-identifier hs-var">orig_bndrs</span></a></span><span>
</span><span id="line-900"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Orig lhs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681149013"><span class="hs-identifier hs-var">orig_lhs</span></a></span><span>
</span><span id="line-901"></span><span>                              </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;optimised lhs:&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148995"><span class="hs-identifier hs-var">lhs2</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-902"></span><span>   </span><span id="local-6989586621681148969"><span class="annot"><span class="annottext">pp_bndr :: EvVar -&gt; SDoc
</span><a href="#local-6989586621681148969"><span class="hs-identifier hs-var hs-var">pp_bndr</span></a></span></span><span> </span><span id="local-6989586621681148965"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148965"><span class="hs-identifier hs-var">bndr</span></a></span></span><span>
</span><span id="line-903"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Bool
</span><a href="GHC.Types.Var.html#isTyVar"><span class="hs-identifier hs-var">isTyVar</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148965"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;type variable&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148965"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-904"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Bool
</span><a href="GHC.Core.Predicate.html#isEvVar"><span class="hs-identifier hs-var">isEvVar</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148965"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;constraint&quot;</span></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148965"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-905"></span><span>    </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;variable&quot;</span></span><span>      </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#quotes"><span class="hs-identifier hs-var">quotes</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148965"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-906"></span><span>
</span><span id="line-907"></span><span>   </span><span id="local-6989586621681149005"><span class="annot"><span class="annottext">constructor_msg :: a -&gt; SDoc
</span><a href="#local-6989586621681149005"><span class="hs-identifier hs-var hs-var">constructor_msg</span></a></span></span><span> </span><span id="local-6989586621681148960"><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681148960"><span class="hs-identifier hs-var">con</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span>
</span><span id="line-908"></span><span>     </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;A constructor,&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">a -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">a
</span><a href="#local-6989586621681148960"><span class="hs-identifier hs-var">con</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span>
</span><span id="line-909"></span><span>         </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;, appears as outermost match in RULE lhs.&quot;</span></span><span>
</span><span id="line-910"></span><span>     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;This rule will be ignored.&quot;</span></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-911"></span><span>
</span><span id="line-912"></span><span>   </span><span class="annot"><a href="#local-6989586621681148996"><span class="hs-identifier hs-type">drop_dicts</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-913"></span><span>   </span><span id="local-6989586621681148996"><span class="annot"><span class="annottext">drop_dicts :: CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148996"><span class="hs-identifier hs-var hs-var">drop_dicts</span></a></span></span><span> </span><span id="local-6989586621681148958"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148958"><span class="hs-identifier hs-var">e</span></a></span></span><span>
</span><span id="line-914"></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; [(EvVar, CoreExpr)] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148957"><span class="hs-identifier hs-var">wrap_lets</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148956"><span class="hs-identifier hs-var">needed</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148955"><span class="hs-identifier hs-var">bnds</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148954"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-915"></span><span>     </span><span class="hs-keyword">where</span><span>
</span><span id="line-916"></span><span>       </span><span id="local-6989586621681148956"><span class="annot"><span class="annottext">needed :: VarSet
</span><a href="#local-6989586621681148956"><span class="hs-identifier hs-var hs-var">needed</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148989"><span class="hs-identifier hs-var">orig_bndr_set</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#minusVarSet"><span class="hs-operator hs-var">`minusVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; VarSet
</span><a href="GHC.Core.FVs.html#exprFreeVars"><span class="hs-identifier hs-var">exprFreeVars</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148954"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-917"></span><span>       </span><span class="hs-special">(</span><span id="local-6989586621681148955"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148955"><span class="hs-identifier hs-var">bnds</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148954"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148954"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; ([(EvVar, CoreExpr)], CoreExpr)
</span><a href="#local-6989586621681148952"><span class="hs-identifier hs-var">split_lets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Opt.OccurAnal.html#occurAnalyseExpr"><span class="hs-identifier hs-var">occurAnalyseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148958"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-918"></span><span>           </span><span class="hs-comment">-- The occurAnalyseExpr drops dead bindings which is</span><span>
</span><span id="line-919"></span><span>           </span><span class="hs-comment">-- crucial to ensure that every binding is used later;</span><span>
</span><span id="line-920"></span><span>           </span><span class="hs-comment">-- which in turn makes wrap_lets work right</span><span>
</span><span id="line-921"></span><span>
</span><span id="line-922"></span><span>   </span><span class="annot"><a href="#local-6989586621681148952"><span class="hs-identifier hs-type">split_lets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#DictId"><span class="hs-identifier hs-type">DictId</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-923"></span><span>   </span><span id="local-6989586621681148952"><span class="annot"><span class="annottext">split_lets :: CoreExpr -&gt; ([(EvVar, CoreExpr)], CoreExpr)
</span><a href="#local-6989586621681148952"><span class="hs-identifier hs-var hs-var">split_lets</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Let"><span class="hs-identifier hs-type">Let</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681148950"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148950"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span id="local-6989586621681148949"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148949"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681148948"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148948"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-924"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Bool
</span><a href="GHC.Core.Predicate.html#isDictId"><span class="hs-identifier hs-var">isDictId</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148950"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-925"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148950"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148949"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">(EvVar, CoreExpr) -&gt; [(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148947"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148946"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-926"></span><span>     </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148947"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148947"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148946"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148946"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; ([(EvVar, CoreExpr)], CoreExpr)
</span><a href="#local-6989586621681148952"><span class="hs-identifier hs-var">split_lets</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148948"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-927"></span><span>
</span><span id="line-928"></span><span>    </span><span class="hs-comment">-- handle &quot;unlifted lets&quot; too, needed for &quot;map/coerce&quot;</span><span>
</span><span id="line-929"></span><span>   </span><span class="annot"><a href="#local-6989586621681148952"><span class="hs-identifier hs-var">split_lets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Case"><span class="hs-identifier hs-type">Case</span></a></span><span> </span><span id="local-6989586621681148944"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148944"><span class="hs-identifier hs-var">r</span></a></span></span><span> </span><span id="local-6989586621681148943"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148943"><span class="hs-identifier hs-var">d</span></a></span></span><span> </span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">AltCon
</span><a href="GHC.Core.html#DEFAULT"><span class="hs-identifier hs-var">DEFAULT</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148941"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148941"><span class="hs-identifier hs-var">body</span></a></span></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-930"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; Bool
</span><a href="GHC.Types.Var.html#isCoVar"><span class="hs-identifier hs-var">isCoVar</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148943"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-931"></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148943"><span class="hs-identifier hs-var">d</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148944"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span class="annot"><span class="annottext">(EvVar, CoreExpr) -&gt; [(EvVar, CoreExpr)] -&gt; [(EvVar, CoreExpr)]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148939"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148938"><span class="hs-identifier hs-var">body'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-932"></span><span>     </span><span class="hs-keyword">where</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148939"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148939"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148938"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148938"><span class="hs-identifier hs-var">body'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; ([(EvVar, CoreExpr)], CoreExpr)
</span><a href="#local-6989586621681148952"><span class="hs-identifier hs-var">split_lets</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148941"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-933"></span><span>
</span><span id="line-934"></span><span>   </span><span class="annot"><a href="#local-6989586621681148952"><span class="hs-identifier hs-var">split_lets</span></a></span><span> </span><span id="local-6989586621681148937"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148937"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="hs-special">[</span><span class="hs-special">]</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148937"><span class="hs-identifier hs-var">e</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-935"></span><span>
</span><span id="line-936"></span><span>   </span><span class="annot"><a href="#local-6989586621681148957"><span class="hs-identifier hs-type">wrap_lets</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html#VarSet"><span class="hs-identifier hs-type">VarSet</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#DictId"><span class="hs-identifier hs-type">DictId</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-937"></span><span>   </span><span id="local-6989586621681148957"><span class="annot"><span class="annottext">wrap_lets :: VarSet -&gt; [(EvVar, CoreExpr)] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148957"><span class="hs-identifier hs-var hs-var">wrap_lets</span></a></span></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span id="local-6989586621681148936"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148936"><span class="hs-identifier hs-var">body</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148936"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-938"></span><span>   </span><span class="annot"><a href="#local-6989586621681148957"><span class="hs-identifier hs-var">wrap_lets</span></a></span><span> </span><span id="local-6989586621681148935"><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148935"><span class="hs-identifier hs-var">needed</span></a></span></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681148934"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148934"><span class="hs-identifier hs-var">d</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148933"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148933"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681148932"><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148932"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681148931"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148931"><span class="hs-identifier hs-var">body</span></a></span></span><span>
</span><span id="line-939"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148930"><span class="hs-identifier hs-var">rhs_fvs</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#intersectsVarSet"><span class="hs-operator hs-var">`intersectsVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148935"><span class="hs-identifier hs-var">needed</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreBind -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLet"><span class="hs-identifier hs-var">mkCoreLet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr -&gt; CoreBind
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148934"><span class="hs-identifier hs-var">d</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148933"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">VarSet -&gt; [(EvVar, CoreExpr)] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148957"><span class="hs-identifier hs-var">wrap_lets</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148927"><span class="hs-identifier hs-var">needed'</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148932"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148931"><span class="hs-identifier hs-var">body</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-940"></span><span>     </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; [(EvVar, CoreExpr)] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148957"><span class="hs-identifier hs-var">wrap_lets</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148935"><span class="hs-identifier hs-var">needed</span></a></span><span> </span><span class="annot"><span class="annottext">[(EvVar, CoreExpr)]
</span><a href="#local-6989586621681148932"><span class="hs-identifier hs-var">bs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148931"><span class="hs-identifier hs-var">body</span></a></span><span>
</span><span id="line-941"></span><span>     </span><span class="hs-keyword">where</span><span>
</span><span id="line-942"></span><span>       </span><span id="local-6989586621681148930"><span class="annot"><span class="annottext">rhs_fvs :: VarSet
</span><a href="#local-6989586621681148930"><span class="hs-identifier hs-var hs-var">rhs_fvs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; VarSet
</span><a href="GHC.Core.FVs.html#exprFreeVars"><span class="hs-identifier hs-var">exprFreeVars</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148933"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-943"></span><span>       </span><span id="local-6989586621681148927"><span class="annot"><span class="annottext">needed' :: VarSet
</span><a href="#local-6989586621681148927"><span class="hs-identifier hs-var hs-var">needed'</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148935"><span class="hs-identifier hs-var">needed</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#minusVarSet"><span class="hs-operator hs-var">`minusVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681148930"><span class="hs-identifier hs-var">rhs_fvs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; EvVar -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#extendVarSet"><span class="hs-operator hs-var">`extendVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148934"><span class="hs-identifier hs-var">d</span></a></span><span>
</span><span id="line-944"></span><span>
</span><span id="line-945"></span><span class="hs-comment">{-
Note [Decomposing the left-hand side of a RULE]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
There are several things going on here.
* drop_dicts: see Note [Drop dictionary bindings on rule LHS]
* simpleOptExpr: see Note [Simplify rule LHS]
* extra_dict_bndrs: see Note [Free dictionaries]

Note [Free tyvars on rule LHS]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
  data T a = C

  foo :: T a -&gt; Int
  foo C = 1

  {-# RULES &quot;myrule&quot;  foo C = 1 #-}

After type checking the LHS becomes (foo alpha (C alpha)), where alpha
is an unbound meta-tyvar.  The zonker in GHC.Tc.Utils.Zonk is careful not to
turn the free alpha into Any (as it usually does).  Instead it turns it
into a TyVar 'a'.  See Note [Zonking the LHS of a RULE] in &quot;GHC.Tc.Utils.Zonk&quot;.

Now we must quantify over that 'a'.  It's /really/ inconvenient to do that
in the zonker, because the HsExpr data type is very large.  But it's /easy/
to do it here in the desugarer.

Moreover, we have to do something rather similar for dictionaries;
see Note [Free dictionaries on rule LHS].   So that's why we look for
type variables free on the LHS, and quantify over them.

Note [Free dictionaries on rule LHS]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
When the LHS of a specialisation rule, (/\as\ds. f es) has a free dict,
which is presumably in scope at the function definition site, we can quantify
over it too.  *Any* dict with that type will do.

So for example when you have
        f :: Eq a =&gt; a -&gt; a
        f = &lt;rhs&gt;
        ... SPECIALISE f :: Int -&gt; Int ...

Then we get the SpecPrag
        SpecPrag (f Int dInt)

And from that we want the rule

        RULE forall dInt. f Int dInt = f_spec
        f_spec = let f = &lt;rhs&gt; in f Int dInt

But be careful!  That dInt might be GHC.Base.$fOrdInt, which is an External
Name, and you can't bind them in a lambda or forall without getting things
confused.   Likewise it might have an InlineRule or something, which would be
utterly bogus. So we really make a fresh Id, with the same unique and type
as the old one, but with an Internal name and no IdInfo.

Note [Drop dictionary bindings on rule LHS]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drop_dicts drops dictionary bindings on the LHS where possible.
   E.g.  let d:Eq [Int] = $fEqList $fEqInt in f d
     --&gt; f d
   Reasoning here is that there is only one d:Eq [Int], and so we can
   quantify over it. That makes 'd' free in the LHS, but that is later
   picked up by extra_dict_bndrs (Note [Dead spec binders]).

   NB 1: We can only drop the binding if the RHS doesn't bind
         one of the orig_bndrs, which we assume occur on RHS.
         Example
            f :: (Eq a) =&gt; b -&gt; a -&gt; a
            {-# SPECIALISE f :: Eq a =&gt; b -&gt; [a] -&gt; [a] #-}
         Here we want to end up with
            RULE forall d:Eq a.  f ($dfEqList d) = f_spec d
         Of course, the ($dfEqlist d) in the pattern makes it less likely
         to match, but there is no other way to get d:Eq a

   NB 2: We do drop_dicts *before* simplOptEpxr, so that we expect all
         the evidence bindings to be wrapped around the outside of the
         LHS.  (After simplOptExpr they'll usually have been inlined.)
         dsHsWrapper does dependency analysis, so that civilised ones
         will be simple NonRec bindings.  We don't handle recursive
         dictionaries!

    NB3: In the common case of a non-overloaded, but perhaps-polymorphic
         specialisation, we don't need to bind *any* dictionaries for use
         in the RHS. For example (#8331)
             {-# SPECIALIZE INLINE useAbstractMonad :: ReaderST s Int #-}
             useAbstractMonad :: MonadAbstractIOST m =&gt; m Int
         Here, deriving (MonadAbstractIOST (ReaderST s)) is a lot of code
         but the RHS uses no dictionaries, so we want to end up with
             RULE forall s (d :: MonadAbstractIOST (ReaderT s)).
                useAbstractMonad (ReaderT s) d = $suseAbstractMonad s

   #8848 is a good example of where there are some interesting
   dictionary bindings to discard.

The drop_dicts algorithm is based on these observations:

  * Given (let d = rhs in e) where d is a DictId,
    matching 'e' will bind e's free variables.

  * So we want to keep the binding if one of the needed variables (for
    which we need a binding) is in fv(rhs) but not already in fv(e).

  * The &quot;needed variables&quot; are simply the orig_bndrs.  Consider
       f :: (Eq a, Show b) =&gt; a -&gt; b -&gt; String
       ... SPECIALISE f :: (Show b) =&gt; Int -&gt; b -&gt; String ...
    Then orig_bndrs includes the *quantified* dictionaries of the type
    namely (dsb::Show b), but not the one for Eq Int

So we work inside out, applying the above criterion at each step.


Note [Simplify rule LHS]
~~~~~~~~~~~~~~~~~~~~~~~~
simplOptExpr occurrence-analyses and simplifies the LHS:

   (a) Inline any remaining dictionary bindings (which hopefully
       occur just once)

   (b) Substitute trivial lets, so that they don't get in the way.
       Note that we substitute the function too; we might
       have this as a LHS:  let f71 = M.f Int in f71

   (c) Do eta reduction.  To see why, consider the fold/build rule,
       which without simplification looked like:
          fold k z (build (/\a. g a))  ==&gt;  ...
       This doesn't match unless you do eta reduction on the build argument.
       Similarly for a LHS like
         augment g (build h)
       we do not want to get
         augment (\a. g a) (build h)
       otherwise we don't match when given an argument like
          augment (\a. h a a) (build h)

Note [Unused spec binders]
~~~~~~~~~~~~~~~~~~~~~~~~~~
Consider
        f :: a -&gt; a
        ... SPECIALISE f :: Eq a =&gt; a -&gt; a ...
It's true that this *is* a more specialised type, but the rule
we get is something like this:
        f_spec d = f
        RULE: f = f_spec d
Note that the rule is bogus, because it mentions a 'd' that is
not bound on the LHS!  But it's a silly specialisation anyway, because
the constraint is unused.  We could bind 'd' to (error &quot;unused&quot;)
but it seems better to reject the program because it's almost certainly
a mistake.  That's what the isDeadBinder call detects.

Note [No RULES on datacons]
~~~~~~~~~~~~~~~~~~~~~~~~~~~

Previously, `RULES` like

    &quot;JustNothing&quot; forall x . Just x = Nothing

were allowed. Simon Peyton Jones says this seems to have been a
mistake, that such rules have never been supported intentionally,
and that he doesn't know if they can break in horrible ways.
Furthermore, Ben Gamari and Reid Barton are considering trying to
detect the presence of &quot;static data&quot; that the simplifier doesn't
need to traverse at all. Such rules do not play well with that.
So for now, we ban them altogether as requested by #13290. See also #7398.


************************************************************************
*                                                                      *
                Desugaring evidence
*                                                                      *
************************************************************************

-}</span><span>
</span><span id="line-1117"></span><span>
</span><span id="line-1118"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-type">dsHsWrapper</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#HsWrapper"><span class="hs-identifier hs-type">HsWrapper</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1119"></span><span id="dsHsWrapper"><span class="annot"><span class="annottext">dsHsWrapper :: HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var hs-var">dsHsWrapper</span></a></span></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="GHC.Tc.Types.Evidence.html#WpHole"><span class="hs-identifier hs-var">WpHole</span></a></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr))
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681148925"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148925"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148925"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1120"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpTyApp"><span class="hs-identifier hs-type">WpTyApp</span></a></span><span> </span><span id="local-6989586621681148923"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148923"><span class="hs-identifier hs-var">ty</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr))
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681148922"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148922"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148922"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148923"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1121"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpEvLam"><span class="hs-identifier hs-type">WpEvLam</span></a></span><span> </span><span id="local-6989586621681148918"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148918"><span class="hs-identifier hs-var">ev</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr))
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148918"><span class="hs-identifier hs-var">ev</span></a></span><span>
</span><span id="line-1122"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpTyLam"><span class="hs-identifier hs-type">WpTyLam</span></a></span><span> </span><span id="local-6989586621681148915"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148915"><span class="hs-identifier hs-var">tv</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr))
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148915"><span class="hs-identifier hs-var">tv</span></a></span><span>
</span><span id="line-1123"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpLet"><span class="hs-identifier hs-type">WpLet</span></a></span><span> </span><span id="local-6989586621681148913"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681148913"><span class="hs-identifier hs-var">ev_binds</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148912"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681148912"><span class="hs-identifier hs-var">bs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcEvBinds -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsTcEvBinds"><span class="hs-identifier hs-var">dsTcEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681148913"><span class="hs-identifier hs-var">ev_binds</span></a></span><span>
</span><span id="line-1124"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreBind] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLets"><span class="hs-identifier hs-var">mkCoreLets</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681148912"><span class="hs-identifier hs-var">bs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1125"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpCompose"><span class="hs-identifier hs-type">WpCompose</span></a></span><span> </span><span id="local-6989586621681148910"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681148910"><span class="hs-identifier hs-var">c1</span></a></span></span><span> </span><span id="local-6989586621681148909"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681148909"><span class="hs-identifier hs-var">c2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148908"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148908"><span class="hs-identifier hs-var">w1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681148910"><span class="hs-identifier hs-var">c1</span></a></span><span>
</span><span id="line-1126"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148907"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148907"><span class="hs-identifier hs-var">w2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681148909"><span class="hs-identifier hs-var">c2</span></a></span><span>
</span><span id="line-1127"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148908"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr)
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148907"><span class="hs-identifier hs-var">w2</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1128"></span><span> </span><span class="hs-comment">-- See comments on WpFun in GHC.Tc.Types.Evidence for an explanation of what</span><span>
</span><span id="line-1129"></span><span> </span><span class="hs-comment">-- the specification of this clause is</span><span>
</span><span id="line-1130"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpFun"><span class="hs-identifier hs-type">WpFun</span></a></span><span> </span><span id="local-6989586621681148905"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681148905"><span class="hs-identifier hs-var">c1</span></a></span></span><span> </span><span id="local-6989586621681148904"><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681148904"><span class="hs-identifier hs-var">c2</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Scaled"><span class="hs-identifier hs-type">Scaled</span></a></span><span> </span><span id="local-6989586621681148902"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148902"><span class="hs-identifier hs-var">w</span></a></span></span><span> </span><span id="local-6989586621681148901"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148901"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">)</span><span> </span><span id="local-6989586621681148900"><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681148900"><span class="hs-identifier hs-var">doc</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1131"></span><span>                              </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148899"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148899"><span class="hs-identifier hs-var">x</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#newSysLocalDsNoLP"><span class="hs-identifier hs-var">newSysLocalDsNoLP</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148902"><span class="hs-identifier hs-var">w</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148901"><span class="hs-identifier hs-var">t1</span></a></span><span>
</span><span id="line-1132"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148897"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148897"><span class="hs-identifier hs-var">w1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681148905"><span class="hs-identifier hs-var">c1</span></a></span><span>
</span><span id="line-1133"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148896"><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148896"><span class="hs-identifier hs-var">w2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HsWrapper -&gt; DsM (CoreExpr -&gt; CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="annot"><span class="annottext">HsWrapper
</span><a href="#local-6989586621681148904"><span class="hs-identifier hs-var">c2</span></a></span><span>
</span><span id="line-1134"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148895"><span class="annot"><span class="annottext">app :: CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148895"><span class="hs-identifier hs-var hs-var">app</span></a></span></span><span> </span><span id="local-6989586621681148894"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148894"><span class="hs-identifier hs-var">f</span></a></span></span><span> </span><span id="local-6989586621681148893"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148893"><span class="hs-identifier hs-var">a</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkCoreAppDs"><span class="hs-identifier hs-var">mkCoreAppDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsHsWrapper&quot;</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148894"><span class="hs-identifier hs-var">f</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148893"><span class="hs-identifier hs-var">a</span></a></span><span>
</span><span id="line-1135"></span><span>                                         </span><span id="local-6989586621681148891"><span class="annot"><span class="annottext">arg :: CoreExpr
</span><a href="#local-6989586621681148891"><span class="hs-identifier hs-var hs-var">arg</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148897"><span class="hs-identifier hs-var">w1</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148899"><span class="hs-identifier hs-var">x</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1136"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">()
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148890"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681148890"><span class="hs-identifier hs-var">ok</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IOEnv (Env DsGblEnv DsLclEnv) () -&gt; DsM ((), Bool)
forall a. DsM a -&gt; DsM (a, Bool)
</span><a href="GHC.HsToCore.Monad.html#askNoErrsDs"><span class="hs-identifier hs-var">askNoErrsDs</span></a></span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env DsGblEnv DsLclEnv) () -&gt; DsM ((), Bool))
-&gt; IOEnv (Env DsGblEnv DsLclEnv) () -&gt; DsM ((), Bool)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="GHC.HsToCore.Monad.html#dsNoLevPolyExpr"><span class="hs-identifier hs-var">dsNoLevPolyExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148891"><span class="hs-identifier hs-var">arg</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681148900"><span class="hs-identifier hs-var">doc</span></a></span><span>
</span><span id="line-1137"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681148890"><span class="hs-identifier hs-var">ok</span></a></span><span>
</span><span id="line-1138"></span><span>                                     </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681148887"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148887"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr -&gt; CoreExpr
forall b. b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#Lam"><span class="hs-identifier hs-var">Lam</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148899"><span class="hs-identifier hs-var">x</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148896"><span class="hs-identifier hs-var">w2</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
</span><a href="#local-6989586621681148895"><span class="hs-identifier hs-var">app</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148887"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148891"><span class="hs-identifier hs-var">arg</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1139"></span><span>                                     </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
forall a. a -&gt; a
</span><a href="../../base/src/GHC.Base.html#id"><span class="hs-identifier hs-var">id</span></a></span><span> </span><span class="hs-special">}</span><span>  </span><span class="hs-comment">-- this return is irrelevant</span><span>
</span><span id="line-1140"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpCast"><span class="hs-identifier hs-type">WpCast</span></a></span><span> </span><span id="local-6989586621681148885"><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681148885"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span class="hs-identifier">coercionRole</span><span> </span><span class="hs-identifier">co</span><span> </span><span class="hs-operator">==</span><span> </span><span class="hs-identifier">Representational</span><span class="hs-special">)</span><span>
</span><span id="line-1141"></span><span>                                </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr))
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681148881"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148881"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; TcCoercionR -&gt; CoreExpr
</span><a href="GHC.HsToCore.Utils.html#mkCastDs"><span class="hs-identifier hs-var">mkCastDs</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148881"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681148885"><span class="hs-identifier hs-var">co</span></a></span><span>
</span><span id="line-1142"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpEvApp"><span class="hs-identifier hs-type">WpEvApp</span></a></span><span> </span><span id="local-6989586621681148878"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148878"><span class="hs-identifier hs-var">tm</span></a></span></span><span class="hs-special">)</span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148877"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148877"><span class="hs-identifier hs-var">core_tm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#dsEvTerm"><span class="hs-identifier hs-var">dsEvTerm</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148878"><span class="hs-identifier hs-var">tm</span></a></span><span>
</span><span id="line-1143"></span><span>                                   </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681148875"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148875"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr -&gt; CoreExpr
forall b. Expr b -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#App"><span class="hs-identifier hs-var">App</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148875"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148877"><span class="hs-identifier hs-var">core_tm</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1144"></span><span>  </span><span class="hs-comment">-- See Note [Wrapper returned from tcSubMult] in GHC.Tc.Utils.Unify.</span><span>
</span><span id="line-1145"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsHsWrapper"><span class="hs-identifier hs-var">dsHsWrapper</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#WpMultCoercion"><span class="hs-identifier hs-type">WpMultCoercion</span></a></span><span> </span><span id="local-6989586621681148873"><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681148873"><span class="hs-identifier hs-var">co</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">Bool
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TcCoercionR -&gt; Bool
</span><a href="GHC.Core.Coercion.html#isReflexiveCo"><span class="hs-identifier hs-var">isReflexiveCo</span></a></span><span> </span><span class="annot"><span class="annottext">TcCoercionR
</span><a href="#local-6989586621681148873"><span class="hs-identifier hs-var">co</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IOEnv (Env DsGblEnv DsLclEnv) ()
 -&gt; IOEnv (Env DsGblEnv DsLclEnv) ())
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
-&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1146"></span><span>                                         </span><span class="annot"><span class="annottext">SDoc -&gt; IOEnv (Env DsGblEnv DsLclEnv) ()
</span><a href="GHC.HsToCore.Monad.html#errDs"><span class="hs-identifier hs-var">errDs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Multiplicity coercions are currently not supported&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-1147"></span><span>                                     </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr))
-&gt; (CoreExpr -&gt; CoreExpr) -&gt; DsM (CoreExpr -&gt; CoreExpr)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681148871"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148871"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148871"><span class="hs-identifier hs-var">e</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1148"></span><span class="hs-comment">--------------------------------------</span><span>
</span><span id="line-1149"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsTcEvBinds_s"><span class="hs-identifier hs-type">dsTcEvBinds_s</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcEvBinds"><span class="hs-identifier hs-type">TcEvBinds</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1150"></span><span id="dsTcEvBinds_s"><span class="annot"><span class="annottext">dsTcEvBinds_s :: [TcEvBinds] -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsTcEvBinds_s"><span class="hs-identifier hs-var hs-var">dsTcEvBinds_s</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreBind] -&gt; DsM [CoreBind]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-1151"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsTcEvBinds_s"><span class="hs-identifier hs-var">dsTcEvBinds_s</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148870"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681148870"><span class="hs-identifier hs-var">b</span></a></span></span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span id="local-6989586621681148869"><span class="annot"><span class="annottext">[TcEvBinds]
</span><a href="#local-6989586621681148869"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">ASSERT</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">null</span><span> </span><span class="hs-identifier">rest</span><span> </span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Zonker ensures null</span><span>
</span><span id="line-1152"></span><span>                         </span><span class="annot"><span class="annottext">TcEvBinds -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsTcEvBinds"><span class="hs-identifier hs-var">dsTcEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681148870"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1153"></span><span>
</span><span id="line-1154"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsTcEvBinds"><span class="hs-identifier hs-type">dsTcEvBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcEvBinds"><span class="hs-identifier hs-type">TcEvBinds</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1155"></span><span id="dsTcEvBinds"><span class="annot"><span class="annottext">dsTcEvBinds :: TcEvBinds -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsTcEvBinds"><span class="hs-identifier hs-var hs-var">dsTcEvBinds</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#TcEvBinds"><span class="hs-identifier hs-type">TcEvBinds</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; DsM [CoreBind]
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsEvBinds&quot;</span></span><span>    </span><span class="hs-comment">-- Zonker has got rid of this</span><span>
</span><span id="line-1156"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsTcEvBinds"><span class="hs-identifier hs-var">dsTcEvBinds</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBinds"><span class="hs-identifier hs-type">EvBinds</span></a></span><span> </span><span id="local-6989586621681148866"><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681148866"><span class="hs-identifier hs-var">bs</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bag EvBind -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsEvBinds"><span class="hs-identifier hs-var">dsEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681148866"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1157"></span><span>
</span><span id="line-1158"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsEvBinds"><span class="hs-identifier hs-type">dsEvBinds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBind"><span class="hs-identifier hs-type">EvBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1159"></span><span id="dsEvBinds"><span class="annot"><span class="annottext">dsEvBinds :: Bag EvBind -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsEvBinds"><span class="hs-identifier hs-var hs-var">dsEvBinds</span></a></span></span><span> </span><span id="local-6989586621681148865"><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681148865"><span class="hs-identifier hs-var">bs</span></a></span></span><span>
</span><span id="line-1160"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148864"><span class="annot"><span class="annottext">Bag (EvVar, CoreExpr)
</span><a href="#local-6989586621681148864"><span class="hs-identifier hs-var">ds_bs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(EvBind -&gt; IOEnv (Env DsGblEnv DsLclEnv) (EvVar, CoreExpr))
-&gt; Bag EvBind
-&gt; IOEnv (Env DsGblEnv DsLclEnv) (Bag (EvVar, CoreExpr))
forall (m :: * -&gt; *) a b.
Monad m =&gt;
(a -&gt; m b) -&gt; Bag a -&gt; m (Bag b)
</span><a href="GHC.Data.Bag.html#mapBagM"><span class="hs-identifier hs-var">mapBagM</span></a></span><span> </span><span class="annot"><span class="annottext">EvBind -&gt; IOEnv (Env DsGblEnv DsLclEnv) (EvVar, CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsEvBind"><span class="hs-identifier hs-var">dsEvBind</span></a></span><span> </span><span class="annot"><span class="annottext">Bag EvBind
</span><a href="#local-6989586621681148865"><span class="hs-identifier hs-var">bs</span></a></span><span>
</span><span id="line-1161"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[CoreBind] -&gt; DsM [CoreBind]
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bag (EvVar, CoreExpr) -&gt; [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#mk_ev_binds"><span class="hs-identifier hs-var">mk_ev_binds</span></a></span><span> </span><span class="annot"><span class="annottext">Bag (EvVar, CoreExpr)
</span><a href="#local-6989586621681148864"><span class="hs-identifier hs-var">ds_bs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1162"></span><span>
</span><span id="line-1163"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#mk_ev_binds"><span class="hs-identifier hs-type">mk_ev_binds</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Data.Bag.html#Bag"><span class="hs-identifier hs-type">Bag</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1164"></span><span class="hs-comment">-- We do SCC analysis of the evidence bindings, /after/ desugaring</span><span>
</span><span id="line-1165"></span><span class="hs-comment">-- them. This is convenient: it means we can use the GHC.Core</span><span>
</span><span id="line-1166"></span><span class="hs-comment">-- free-variable functions rather than having to do accurate free vars</span><span>
</span><span id="line-1167"></span><span class="hs-comment">-- for EvTerm.</span><span>
</span><span id="line-1168"></span><span id="mk_ev_binds"><span class="annot"><span class="annottext">mk_ev_binds :: Bag (EvVar, CoreExpr) -&gt; [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#mk_ev_binds"><span class="hs-identifier hs-var hs-var">mk_ev_binds</span></a></span></span><span> </span><span id="local-6989586621681148861"><span class="annot"><span class="annottext">Bag (EvVar, CoreExpr)
</span><a href="#local-6989586621681148861"><span class="hs-identifier hs-var">ds_binds</span></a></span></span><span>
</span><span id="line-1169"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SCC (EvVar, CoreExpr) -&gt; CoreBind)
-&gt; [SCC (EvVar, CoreExpr)] -&gt; [CoreBind]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">SCC (EvVar, CoreExpr) -&gt; CoreBind
forall {b}. SCC (b, Expr b) -&gt; Bind b
</span><a href="#local-6989586621681148860"><span class="hs-identifier hs-var">ds_scc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[Node EvVar (EvVar, CoreExpr)] -&gt; [SCC (EvVar, CoreExpr)]
forall key payload.
Uniquable key =&gt;
[Node key payload] -&gt; [SCC payload]
</span><a href="GHC.Data.Graph.Directed.html#stronglyConnCompFromEdgedVerticesUniq"><span class="hs-identifier hs-var">stronglyConnCompFromEdgedVerticesUniq</span></a></span><span> </span><span class="annot"><span class="annottext">[Node EvVar (EvVar, CoreExpr)]
</span><a href="#local-6989586621681148858"><span class="hs-identifier hs-var">edges</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1170"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1171"></span><span>    </span><span class="annot"><a href="#local-6989586621681148858"><span class="hs-identifier hs-type">edges</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><a href="GHC.Data.Graph.Directed.html#Node"><span class="hs-identifier hs-type">Node</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1172"></span><span>    </span><span id="local-6989586621681148858"><span class="annot"><span class="annottext">edges :: [Node EvVar (EvVar, CoreExpr)]
</span><a href="#local-6989586621681148858"><span class="hs-identifier hs-var hs-var">edges</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((EvVar, CoreExpr)
 -&gt; [Node EvVar (EvVar, CoreExpr)]
 -&gt; [Node EvVar (EvVar, CoreExpr)])
-&gt; [Node EvVar (EvVar, CoreExpr)]
-&gt; Bag (EvVar, CoreExpr)
-&gt; [Node EvVar (EvVar, CoreExpr)]
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-glyph">:</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(Node EvVar (EvVar, CoreExpr)
 -&gt; [Node EvVar (EvVar, CoreExpr)]
 -&gt; [Node EvVar (EvVar, CoreExpr)])
-&gt; ((EvVar, CoreExpr) -&gt; Node EvVar (EvVar, CoreExpr))
-&gt; (EvVar, CoreExpr)
-&gt; [Node EvVar (EvVar, CoreExpr)]
-&gt; [Node EvVar (EvVar, CoreExpr)]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">(EvVar, CoreExpr) -&gt; Node EvVar (EvVar, CoreExpr)
</span><a href="#local-6989586621681148857"><span class="hs-identifier hs-var">mk_node</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Bag (EvVar, CoreExpr)
</span><a href="#local-6989586621681148861"><span class="hs-identifier hs-var">ds_binds</span></a></span><span>
</span><span id="line-1173"></span><span>
</span><span id="line-1174"></span><span>    </span><span class="annot"><a href="#local-6989586621681148857"><span class="hs-identifier hs-type">mk_node</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Data.Graph.Directed.html#Node"><span class="hs-identifier hs-type">Node</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#EvVar"><span class="hs-identifier hs-type">EvVar</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1175"></span><span>    </span><span id="local-6989586621681148857"><span class="annot"><span class="annottext">mk_node :: (EvVar, CoreExpr) -&gt; Node EvVar (EvVar, CoreExpr)
</span><a href="#local-6989586621681148857"><span class="hs-identifier hs-var hs-var">mk_node</span></a></span></span><span> </span><span id="local-6989586621681148856"><span class="annot"><span class="annottext">b :: (EvVar, CoreExpr)
</span><a href="#local-6989586621681148856"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span id="local-6989586621681148855"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148855"><span class="hs-identifier hs-var">var</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148854"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148854"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1176"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DigraphNode :: forall key payload. payload -&gt; key -&gt; [key] -&gt; Node key payload
</span><a href="GHC.Data.Graph.Directed.html#DigraphNode"><span class="hs-identifier hs-type">DigraphNode</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">node_payload :: (EvVar, CoreExpr)
</span><a href="GHC.Data.Graph.Directed.html#node_payload"><span class="hs-identifier hs-var">node_payload</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(EvVar, CoreExpr)
</span><a href="#local-6989586621681148856"><span class="hs-identifier hs-var">b</span></a></span><span>
</span><span id="line-1177"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">node_key :: EvVar
</span><a href="GHC.Data.Graph.Directed.html#node_key"><span class="hs-identifier hs-var">node_key</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148855"><span class="hs-identifier hs-var">var</span></a></span><span>
</span><span id="line-1178"></span><span>                    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">node_dependencies :: [EvVar]
</span><a href="GHC.Data.Graph.Directed.html#node_dependencies"><span class="hs-identifier hs-var">node_dependencies</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; [EvVar]
forall elt. UniqSet elt -&gt; [elt]
</span><a href="GHC.Types.Unique.Set.html#nonDetEltsUniqSet"><span class="hs-identifier hs-var">nonDetEltsUniqSet</span></a></span><span> </span><span class="annot"><span class="annottext">(VarSet -&gt; [EvVar]) -&gt; VarSet -&gt; [EvVar]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1179"></span><span>                                          </span><span class="annot"><span class="annottext">CoreExpr -&gt; VarSet
</span><a href="GHC.Core.FVs.html#exprFreeVars"><span class="hs-identifier hs-var">exprFreeVars</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148854"><span class="hs-identifier hs-var">rhs</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet -&gt; VarSet -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#unionVarSet"><span class="hs-operator hs-var">`unionVarSet`</span></a></span><span>
</span><span id="line-1180"></span><span>                                          </span><span class="annot"><span class="annottext">Type -&gt; VarSet
</span><a href="GHC.Core.TyCo.FVs.html#coVarsOfType"><span class="hs-identifier hs-var">coVarsOfType</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; Type
</span><a href="GHC.Types.Var.html#varType"><span class="hs-identifier hs-var hs-var">varType</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148855"><span class="hs-identifier hs-var">var</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1181"></span><span>      </span><span class="hs-comment">-- It's OK to use nonDetEltsUniqSet here as stronglyConnCompFromEdgedVertices</span><span>
</span><span id="line-1182"></span><span>      </span><span class="hs-comment">-- is still deterministic even if the edges are in nondeterministic order</span><span>
</span><span id="line-1183"></span><span>      </span><span class="hs-comment">-- as explained in Note [Deterministic SCC] in GHC.Data.Graph.Directed.</span><span>
</span><span id="line-1184"></span><span>
</span><span id="line-1185"></span><span>    </span><span id="local-6989586621681148860"><span class="annot"><span class="annottext">ds_scc :: SCC (b, Expr b) -&gt; Bind b
</span><a href="#local-6989586621681148860"><span class="hs-identifier hs-var hs-var">ds_scc</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#AcyclicSCC"><span class="hs-identifier hs-type">AcyclicSCC</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148846"><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681148846"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681148845"><span class="annot"><span class="annottext">Expr b
</span><a href="#local-6989586621681148845"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">b -&gt; Expr b -&gt; Bind b
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">b
</span><a href="#local-6989586621681148846"><span class="hs-identifier hs-var">v</span></a></span><span> </span><span class="annot"><span class="annottext">Expr b
</span><a href="#local-6989586621681148845"><span class="hs-identifier hs-var">r</span></a></span><span>
</span><span id="line-1186"></span><span>    </span><span class="annot"><a href="#local-6989586621681148860"><span class="hs-identifier hs-var">ds_scc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../containers/src/Data.Graph.html#CyclicSCC"><span class="hs-identifier hs-type">CyclicSCC</span></a></span><span> </span><span id="local-6989586621681148843"><span class="annot"><span class="annottext">[(b, Expr b)]
</span><a href="#local-6989586621681148843"><span class="hs-identifier hs-var">prs</span></a></span></span><span class="hs-special">)</span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[(b, Expr b)] -&gt; Bind b
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="annot"><span class="annottext">[(b, Expr b)]
</span><a href="#local-6989586621681148843"><span class="hs-identifier hs-var">prs</span></a></span><span>
</span><span id="line-1187"></span><span>
</span><span id="line-1188"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsEvBind"><span class="hs-identifier hs-type">dsEvBind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBind"><span class="hs-identifier hs-type">EvBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1189"></span><span id="dsEvBind"><span class="annot"><span class="annottext">dsEvBind :: EvBind -&gt; IOEnv (Env DsGblEnv DsLclEnv) (EvVar, CoreExpr)
</span><a href="GHC.HsToCore.Binds.html#dsEvBind"><span class="hs-identifier hs-var hs-var">dsEvBind</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvBind"><span class="hs-identifier hs-type">EvBind</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">eb_lhs :: EvBind -&gt; EvVar
</span><a href="GHC.Tc.Types.Evidence.html#eb_lhs"><span class="hs-identifier hs-var">eb_lhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148840"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148840"><span class="hs-identifier hs-var">v</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">eb_rhs :: EvBind -&gt; EvTerm
</span><a href="GHC.Tc.Types.Evidence.html#eb_rhs"><span class="hs-identifier hs-var">eb_rhs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148838"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148838"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">}</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; (EvVar, CoreExpr))
-&gt; DsM CoreExpr -&gt; IOEnv (Env DsGblEnv DsLclEnv) (EvVar, CoreExpr)
forall (m :: * -&gt; *) a1 r. Monad m =&gt; (a1 -&gt; r) -&gt; m a1 -&gt; m r
</span><a href="../../base/src/GHC.Base.html#liftM"><span class="hs-identifier hs-var">liftM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="hs-special">,</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148840"><span class="hs-identifier hs-var">v</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvTerm -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#dsEvTerm"><span class="hs-identifier hs-var">dsEvTerm</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148838"><span class="hs-identifier hs-var">r</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1190"></span><span>
</span><span id="line-1191"></span><span>
</span><span id="line-1192"></span><span class="hs-comment">{-**********************************************************************
*                                                                      *
           Desugaring EvTerms
*                                                                      *
**********************************************************************-}</span><span>
</span><span id="line-1197"></span><span>
</span><span id="line-1198"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsEvTerm"><span class="hs-identifier hs-type">dsEvTerm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier hs-type">EvTerm</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1199"></span><span id="dsEvTerm"><span class="annot"><span class="annottext">dsEvTerm :: EvTerm -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#dsEvTerm"><span class="hs-identifier hs-var hs-var">dsEvTerm</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvExpr"><span class="hs-identifier hs-type">EvExpr</span></a></span><span> </span><span id="local-6989586621681148835"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148835"><span class="hs-identifier hs-var">e</span></a></span></span><span class="hs-special">)</span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148835"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-1200"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsEvTerm"><span class="hs-identifier hs-var">dsEvTerm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTypeable"><span class="hs-identifier hs-type">EvTypeable</span></a></span><span> </span><span id="local-6989586621681148833"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148833"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681148832"><span class="annot"><span class="annottext">EvTypeable
</span><a href="#local-6989586621681148832"><span class="hs-identifier hs-var">ev</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; EvTypeable -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#dsEvTypeable"><span class="hs-identifier hs-var">dsEvTypeable</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148833"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">EvTypeable
</span><a href="#local-6989586621681148832"><span class="hs-identifier hs-var">ev</span></a></span><span>
</span><span id="line-1201"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsEvTerm"><span class="hs-identifier hs-var">dsEvTerm</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvFun"><span class="hs-identifier hs-type">EvFun</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">et_tvs :: EvTerm -&gt; [EvVar]
</span><a href="GHC.Tc.Types.Evidence.html#et_tvs"><span class="hs-identifier hs-var">et_tvs</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148828"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681148828"><span class="hs-identifier hs-var">tvs</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">et_given :: EvTerm -&gt; [EvVar]
</span><a href="GHC.Tc.Types.Evidence.html#et_given"><span class="hs-identifier hs-var">et_given</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148826"><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681148826"><span class="hs-identifier hs-var">given</span></a></span></span><span>
</span><span id="line-1202"></span><span>                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">et_binds :: EvTerm -&gt; TcEvBinds
</span><a href="GHC.Tc.Types.Evidence.html#et_binds"><span class="hs-identifier hs-var">et_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148824"><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681148824"><span class="hs-identifier hs-var">ev_binds</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">et_body :: EvTerm -&gt; EvVar
</span><a href="GHC.Tc.Types.Evidence.html#et_body"><span class="hs-identifier hs-var">et_body</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681148822"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148822"><span class="hs-identifier hs-var">wanted_id</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-1203"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148821"><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681148821"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TcEvBinds -&gt; DsM [CoreBind]
</span><a href="GHC.HsToCore.Binds.html#dsTcEvBinds"><span class="hs-identifier hs-var">dsTcEvBinds</span></a></span><span> </span><span class="annot"><span class="annottext">TcEvBinds
</span><a href="#local-6989586621681148824"><span class="hs-identifier hs-var">ev_binds</span></a></span><span>
</span><span id="line-1204"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr) -&gt; CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar] -&gt; CoreExpr -&gt; CoreExpr
forall b. [b] -&gt; Expr b -&gt; Expr b
</span><a href="GHC.Core.html#mkLams"><span class="hs-identifier hs-var">mkLams</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681148828"><span class="hs-identifier hs-var">tvs</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar] -&gt; [EvVar] -&gt; [EvVar]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[EvVar]
</span><a href="#local-6989586621681148826"><span class="hs-identifier hs-var">given</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1205"></span><span>                   </span><span class="annot"><span class="annottext">[CoreBind] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreLets"><span class="hs-identifier hs-var">mkCoreLets</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreBind]
</span><a href="#local-6989586621681148821"><span class="hs-identifier hs-var">ds_ev_binds</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; CoreExpr) -&gt; CoreExpr -&gt; CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-1206"></span><span>                   </span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148822"><span class="hs-identifier hs-var">wanted_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1207"></span><span>
</span><span id="line-1208"></span><span>
</span><span id="line-1209"></span><span class="hs-comment">{-**********************************************************************
*                                                                      *
           Desugaring Typeable dictionaries
*                                                                      *
**********************************************************************-}</span><span>
</span><span id="line-1214"></span><span>
</span><span id="line-1215"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#dsEvTypeable"><span class="hs-identifier hs-type">dsEvTypeable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTypeable"><span class="hs-identifier hs-type">EvTypeable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1216"></span><span class="hs-comment">-- Return a CoreExpr :: Typeable ty</span><span>
</span><span id="line-1217"></span><span class="hs-comment">-- This code is tightly coupled to the representation</span><span>
</span><span id="line-1218"></span><span class="hs-comment">-- of TypeRep, in base library Data.Typeable.Internals</span><span>
</span><span id="line-1219"></span><span id="dsEvTypeable"><span class="annot"><span class="annottext">dsEvTypeable :: Type -&gt; EvTypeable -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#dsEvTypeable"><span class="hs-identifier hs-var hs-var">dsEvTypeable</span></a></span></span><span> </span><span id="local-6989586621681148820"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148820"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681148819"><span class="annot"><span class="annottext">EvTypeable
</span><a href="#local-6989586621681148819"><span class="hs-identifier hs-var">ev</span></a></span></span><span>
</span><span id="line-1220"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148818"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148818"><span class="hs-identifier hs-var">tyCl</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM TyCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupTyCon"><span class="hs-identifier hs-var">dsLookupTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#typeableClassName"><span class="hs-identifier hs-var">typeableClassName</span></a></span><span>    </span><span class="hs-comment">-- Typeable</span><span>
</span><span id="line-1221"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148815"><span class="annot"><span class="annottext">kind :: Type
</span><a href="#local-6989586621681148815"><span class="hs-identifier hs-var hs-var">kind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148820"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1222"></span><span>             </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148813"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681148813"><span class="hs-identifier hs-var">typeable_data_con</span></a></span></span><span>
</span><span id="line-1223"></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe DataCon
</span><a href="GHC.Core.TyCon.html#tyConSingleDataCon_maybe"><span class="hs-identifier hs-var">tyConSingleDataCon_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148818"><span class="hs-identifier hs-var">tyCl</span></a></span><span>    </span><span class="hs-comment">-- &quot;Data constructor&quot;</span><span>
</span><span id="line-1224"></span><span>                                                    </span><span class="hs-comment">-- for Typeable</span><span>
</span><span id="line-1225"></span><span>
</span><span id="line-1226"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148811"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148811"><span class="hs-identifier hs-var">rep_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; EvTypeable -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#ds_ev_typeable"><span class="hs-identifier hs-var">ds_ev_typeable</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148820"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">EvTypeable
</span><a href="#local-6989586621681148819"><span class="hs-identifier hs-var">ev</span></a></span><span>           </span><span class="hs-comment">-- :: TypeRep a</span><span>
</span><span id="line-1227"></span><span>
</span><span id="line-1228"></span><span>       </span><span class="hs-comment">-- Package up the method as `Typeable` dictionary</span><span>
</span><span id="line-1229"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr) -&gt; CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
forall b. DataCon -&gt; [Arg b] -&gt; Arg b
</span><a href="GHC.Core.html#mkConApp"><span class="hs-identifier hs-var">mkConApp</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681148813"><span class="hs-identifier hs-var">typeable_data_con</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148815"><span class="hs-identifier hs-var">kind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148820"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148811"><span class="hs-identifier hs-var">rep_expr</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1230"></span><span>
</span><span id="line-1231"></span><span class="hs-keyword">type</span><span> </span><span id="TypeRepExpr"><span class="annot"><a href="GHC.HsToCore.Binds.html#TypeRepExpr"><span class="hs-identifier hs-var">TypeRepExpr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1232"></span><span>
</span><span id="line-1233"></span><span class="hs-comment">-- | Returns a @CoreExpr :: TypeRep ty@</span><span>
</span><span id="line-1234"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#ds_ev_typeable"><span class="hs-identifier hs-type">ds_ev_typeable</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTypeable"><span class="hs-identifier hs-type">EvTypeable</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1235"></span><span id="ds_ev_typeable"><span class="annot"><span class="annottext">ds_ev_typeable :: Type -&gt; EvTypeable -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#ds_ev_typeable"><span class="hs-identifier hs-var hs-var">ds_ev_typeable</span></a></span></span><span> </span><span id="local-6989586621681148807"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148807"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTypeableTyCon"><span class="hs-identifier hs-type">EvTypeableTyCon</span></a></span><span> </span><span id="local-6989586621681148805"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148805"><span class="hs-identifier hs-var">tc</span></a></span></span><span> </span><span id="local-6989586621681148804"><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681148804"><span class="hs-identifier hs-var">kind_ev</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1236"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148803"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148803"><span class="hs-identifier hs-var">mkTrCon</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#mkTrConName"><span class="hs-identifier hs-var">mkTrConName</span></a></span><span>
</span><span id="line-1237"></span><span>                    </span><span class="hs-comment">-- mkTrCon :: forall k (a :: k). TyCon -&gt; TypeRep k -&gt; TypeRep a</span><span>
</span><span id="line-1238"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148800"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148800"><span class="hs-identifier hs-var">someTypeRepTyCon</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM TyCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupTyCon"><span class="hs-identifier hs-var">dsLookupTyCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#someTypeRepTyConName"><span class="hs-identifier hs-var">someTypeRepTyConName</span></a></span><span>
</span><span id="line-1239"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148798"><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681148798"><span class="hs-identifier hs-var">someTypeRepDataCon</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM DataCon
</span><a href="GHC.HsToCore.Monad.html#dsLookupDataCon"><span class="hs-identifier hs-var">dsLookupDataCon</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#someTypeRepDataConName"><span class="hs-identifier hs-var">someTypeRepDataConName</span></a></span><span>
</span><span id="line-1240"></span><span>                    </span><span class="hs-comment">-- SomeTypeRep :: forall k (a :: k). TypeRep a -&gt; SomeTypeRep</span><span>
</span><span id="line-1241"></span><span>
</span><span id="line-1242"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148795"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148795"><span class="hs-identifier hs-var">tc_rep</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#tyConRep"><span class="hs-identifier hs-var">tyConRep</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148805"><span class="hs-identifier hs-var">tc</span></a></span><span>                      </span><span class="hs-comment">-- :: TyCon</span><span>
</span><span id="line-1243"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148793"><span class="annot"><span class="annottext">ks :: [Type]
</span><a href="#local-6989586621681148793"><span class="hs-identifier hs-var hs-var">ks</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; [Type]
</span><a href="GHC.Core.Type.html#tyConAppArgs"><span class="hs-identifier hs-var">tyConAppArgs</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148807"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1244"></span><span>             </span><span class="hs-comment">-- Construct a SomeTypeRep</span><span>
</span><span id="line-1245"></span><span>             </span><span class="annot"><a href="#local-6989586621681148791"><span class="hs-identifier hs-type">toSomeTypeRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier hs-type">EvTerm</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1246"></span><span>             </span><span id="local-6989586621681148791"><span class="annot"><span class="annottext">toSomeTypeRep :: Type -&gt; EvTerm -&gt; DsM CoreExpr
</span><a href="#local-6989586621681148791"><span class="hs-identifier hs-var hs-var">toSomeTypeRep</span></a></span></span><span> </span><span id="local-6989586621681148790"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148790"><span class="hs-identifier hs-var">t</span></a></span></span><span> </span><span id="local-6989586621681148789"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148789"><span class="hs-identifier hs-var">ev</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-1247"></span><span>                 </span><span id="local-6989586621681148788"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148788"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#getRep"><span class="hs-identifier hs-var">getRep</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148789"><span class="hs-identifier hs-var">ev</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148790"><span class="hs-identifier hs-var">t</span></a></span><span>
</span><span id="line-1248"></span><span>                 </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr) -&gt; CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkCoreConApps"><span class="hs-identifier hs-var">mkCoreConApps</span></a></span><span> </span><span class="annot"><span class="annottext">DataCon
</span><a href="#local-6989586621681148798"><span class="hs-identifier hs-var">someTypeRepDataCon</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148790"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148790"><span class="hs-identifier hs-var">t</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148788"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1249"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148785"><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681148785"><span class="hs-identifier hs-var">kind_arg_reps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">[DsM CoreExpr] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr]
forall (t :: * -&gt; *) (m :: * -&gt; *) a.
(Traversable t, Monad m) =&gt;
t (m a) -&gt; m (t a)
</span><a href="../../base/src/Data.Traversable.html#sequence"><span class="hs-identifier hs-var">sequence</span></a></span><span> </span><span class="annot"><span class="annottext">([DsM CoreExpr] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr])
-&gt; [DsM CoreExpr] -&gt; IOEnv (Env DsGblEnv DsLclEnv) [CoreExpr]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">(Type -&gt; EvTerm -&gt; DsM CoreExpr)
-&gt; [Type] -&gt; [EvTerm] -&gt; [DsM CoreExpr]
forall a b c. (a -&gt; b -&gt; c) -&gt; [a] -&gt; [b] -&gt; [c]
</span><a href="../../base/src/GHC.List.html#zipWith"><span class="hs-identifier hs-var">zipWith</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; EvTerm -&gt; DsM CoreExpr
</span><a href="#local-6989586621681148791"><span class="hs-identifier hs-var">toSomeTypeRep</span></a></span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681148793"><span class="hs-identifier hs-var">ks</span></a></span><span> </span><span class="annot"><span class="annottext">[EvTerm]
</span><a href="#local-6989586621681148804"><span class="hs-identifier hs-var">kind_ev</span></a></span><span>   </span><span class="hs-comment">-- :: TypeRep t</span><span>
</span><span id="line-1250"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- :: [SomeTypeRep]</span><span>
</span><span id="line-1251"></span><span>             </span><span id="local-6989586621681148782"><span class="annot"><span class="annottext">kind_args :: CoreExpr
</span><a href="#local-6989586621681148782"><span class="hs-identifier hs-var hs-var">kind_args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; [CoreExpr] -&gt; CoreExpr
</span><a href="GHC.Core.Make.html#mkListExpr"><span class="hs-identifier hs-var">mkListExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; Type
</span><a href="GHC.Core.TyCo.Rep.html#mkTyConTy"><span class="hs-identifier hs-var">mkTyConTy</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148800"><span class="hs-identifier hs-var">someTypeRepTyCon</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CoreExpr]
</span><a href="#local-6989586621681148785"><span class="hs-identifier hs-var">kind_arg_reps</span></a></span><span>
</span><span id="line-1252"></span><span>
</span><span id="line-1253"></span><span>         </span><span class="hs-comment">-- Note that we use the kind of the type, not the TyCon from which it</span><span>
</span><span id="line-1254"></span><span>         </span><span class="hs-comment">-- is constructed since the latter may be kind polymorphic whereas the</span><span>
</span><span id="line-1255"></span><span>         </span><span class="hs-comment">-- former we know is not (we checked in the solver).</span><span>
</span><span id="line-1256"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148779"><span class="annot"><span class="annottext">expr :: CoreExpr
</span><a href="#local-6989586621681148779"><span class="hs-identifier hs-var hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148803"><span class="hs-identifier hs-var">mkTrCon</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148807"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1257"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type -&gt; CoreExpr
forall b. Type -&gt; Expr b
</span><a href="GHC.Core.html#Type"><span class="hs-identifier hs-var">Type</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148807"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1258"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148795"><span class="hs-identifier hs-var">tc_rep</span></a></span><span>
</span><span id="line-1259"></span><span>                                         </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148782"><span class="hs-identifier hs-var">kind_args</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1260"></span><span>       </span><span class="hs-comment">-- ; pprRuntimeTrace &quot;Trace mkTrTyCon&quot; (ppr expr) expr</span><span>
</span><span id="line-1261"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148779"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1262"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-1263"></span><span>
</span><span id="line-1264"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#ds_ev_typeable"><span class="hs-identifier hs-var">ds_ev_typeable</span></a></span><span> </span><span id="local-6989586621681148777"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148777"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTypeableTyApp"><span class="hs-identifier hs-type">EvTypeableTyApp</span></a></span><span> </span><span id="local-6989586621681148775"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148775"><span class="hs-identifier hs-var">ev1</span></a></span></span><span> </span><span id="local-6989586621681148774"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148774"><span class="hs-identifier hs-var">ev2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1265"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148773"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148773"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681148772"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148772"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe (Type, Type)
</span><a href="GHC.Core.Type.html#splitAppTy_maybe"><span class="hs-identifier hs-var">splitAppTy_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148777"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1266"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148770"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148770"><span class="hs-identifier hs-var">e1</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#getRep"><span class="hs-identifier hs-var">getRep</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148775"><span class="hs-identifier hs-var">ev1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148773"><span class="hs-identifier hs-var">t1</span></a></span><span>
</span><span id="line-1267"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148769"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148769"><span class="hs-identifier hs-var">e2</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#getRep"><span class="hs-identifier hs-var">getRep</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148774"><span class="hs-identifier hs-var">ev2</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148772"><span class="hs-identifier hs-var">t2</span></a></span><span>
</span><span id="line-1268"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148768"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148768"><span class="hs-identifier hs-var">mkTrApp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#mkTrAppName"><span class="hs-identifier hs-var">mkTrAppName</span></a></span><span>
</span><span id="line-1269"></span><span>                    </span><span class="hs-comment">-- mkTrApp :: forall k1 k2 (a :: k1 -&gt; k2) (b :: k1).</span><span>
</span><span id="line-1270"></span><span>                    </span><span class="hs-comment">--            TypeRep a -&gt; TypeRep b -&gt; TypeRep (a b)</span><span>
</span><span id="line-1271"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type
</span><span class="hs-identifier">_</span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148766"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148766"><span class="hs-identifier hs-var">k1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681148765"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148765"><span class="hs-identifier hs-var">k2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Type -&gt; (Type, Type, Type)
</span><a href="GHC.Core.Type.html#splitFunTy"><span class="hs-identifier hs-var">splitFunTy</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148773"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- drop the multiplicity,</span><span>
</span><span id="line-1272"></span><span>                                                     </span><span class="hs-comment">-- since it's a kind</span><span>
</span><span id="line-1273"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148763"><span class="annot"><span class="annottext">expr :: CoreExpr
</span><a href="#local-6989586621681148763"><span class="hs-identifier hs-var hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [Type] -&gt; CoreExpr
forall b. Expr b -&gt; [Type] -&gt; Expr b
</span><a href="GHC.Core.html#mkTyApps"><span class="hs-identifier hs-var">mkTyApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148768"><span class="hs-identifier hs-var">mkTrApp</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148766"><span class="hs-identifier hs-var">k1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148765"><span class="hs-identifier hs-var">k2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148773"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148772"><span class="hs-identifier hs-var">t2</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1274"></span><span>                            </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148770"><span class="hs-identifier hs-var">e1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148769"><span class="hs-identifier hs-var">e2</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1275"></span><span>       </span><span class="hs-comment">-- ; pprRuntimeTrace &quot;Trace mkTrApp&quot; (ppr expr) expr</span><span>
</span><span id="line-1276"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148763"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-1277"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-1278"></span><span>
</span><span id="line-1279"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#ds_ev_typeable"><span class="hs-identifier hs-var">ds_ev_typeable</span></a></span><span> </span><span id="local-6989586621681148761"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148761"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTypeableTrFun"><span class="hs-identifier hs-type">EvTypeableTrFun</span></a></span><span> </span><span id="local-6989586621681148759"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148759"><span class="hs-identifier hs-var">evm</span></a></span></span><span> </span><span id="local-6989586621681148758"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148758"><span class="hs-identifier hs-var">ev1</span></a></span></span><span> </span><span id="local-6989586621681148757"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148757"><span class="hs-identifier hs-var">ev2</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1280"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681148756"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148756"><span class="hs-identifier hs-var">m</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681148755"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148755"><span class="hs-identifier hs-var">t1</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681148754"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148754"><span class="hs-identifier hs-var">t2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Type -&gt; Maybe (Type, Type, Type)
</span><a href="GHC.Core.Type.html#splitFunTy_maybe"><span class="hs-identifier hs-var">splitFunTy_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148761"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1281"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148752"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148752"><span class="hs-identifier hs-var">e1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#getRep"><span class="hs-identifier hs-var">getRep</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148758"><span class="hs-identifier hs-var">ev1</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148755"><span class="hs-identifier hs-var">t1</span></a></span><span>
</span><span id="line-1282"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148751"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148751"><span class="hs-identifier hs-var">e2</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#getRep"><span class="hs-identifier hs-var">getRep</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148757"><span class="hs-identifier hs-var">ev2</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148754"><span class="hs-identifier hs-var">t2</span></a></span><span>
</span><span id="line-1283"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148750"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148750"><span class="hs-identifier hs-var">em</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#getRep"><span class="hs-identifier hs-var">getRep</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148759"><span class="hs-identifier hs-var">evm</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148756"><span class="hs-identifier hs-var">m</span></a></span><span>
</span><span id="line-1284"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148749"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148749"><span class="hs-identifier hs-var">mkTrFun</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#mkTrFunName"><span class="hs-identifier hs-var">mkTrFunName</span></a></span><span>
</span><span id="line-1285"></span><span>                    </span><span class="hs-comment">-- mkTrFun :: forall (m :: Multiplicity) r1 r2 (a :: TYPE r1) (b :: TYPE r2).</span><span>
</span><span id="line-1286"></span><span>                    </span><span class="hs-comment">--            TypeRep m -&gt; TypeRep a -&gt; TypeRep b -&gt; TypeRep (a # m -&gt; b)</span><span>
</span><span id="line-1287"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148747"><span class="annot"><span class="annottext">r1 :: Type
</span><a href="#local-6989586621681148747"><span class="hs-identifier hs-var hs-var">r1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#getRuntimeRep"><span class="hs-identifier hs-var">getRuntimeRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148755"><span class="hs-identifier hs-var">t1</span></a></span><span>
</span><span id="line-1288"></span><span>             </span><span id="local-6989586621681148745"><span class="annot"><span class="annottext">r2 :: Type
</span><a href="#local-6989586621681148745"><span class="hs-identifier hs-var hs-var">r2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#getRuntimeRep"><span class="hs-identifier hs-var">getRuntimeRep</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148754"><span class="hs-identifier hs-var">t2</span></a></span><span>
</span><span id="line-1289"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreExpr -&gt; DsM CoreExpr) -&gt; CoreExpr -&gt; DsM CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [Type] -&gt; CoreExpr
forall b. Expr b -&gt; [Type] -&gt; Expr b
</span><a href="GHC.Core.html#mkTyApps"><span class="hs-identifier hs-var">mkTyApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148749"><span class="hs-identifier hs-var">mkTrFun</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148756"><span class="hs-identifier hs-var">m</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148747"><span class="hs-identifier hs-var">r1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148745"><span class="hs-identifier hs-var">r2</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148755"><span class="hs-identifier hs-var">t1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148754"><span class="hs-identifier hs-var">t2</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-1290"></span><span>                         </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148750"><span class="hs-identifier hs-var">em</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148752"><span class="hs-identifier hs-var">e1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148751"><span class="hs-identifier hs-var">e2</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-1291"></span><span>       </span><span class="hs-special">}</span><span>
</span><span id="line-1292"></span><span>
</span><span id="line-1293"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#ds_ev_typeable"><span class="hs-identifier hs-var">ds_ev_typeable</span></a></span><span> </span><span id="local-6989586621681148744"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148744"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTypeableTyLit"><span class="hs-identifier hs-type">EvTypeableTyLit</span></a></span><span> </span><span id="local-6989586621681148742"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148742"><span class="hs-identifier hs-var">ev</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-1294"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-comment">-- See Note [Typeable for Nat and Symbol] in GHC.Tc.Solver.Interact</span><span>
</span><span id="line-1295"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148741"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148741"><span class="hs-identifier hs-var">fun</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148740"><span class="hs-identifier hs-var">tr_fun</span></a></span><span>
</span><span id="line-1296"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148739"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148739"><span class="hs-identifier hs-var">dict</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#dsEvTerm"><span class="hs-identifier hs-var">dsEvTerm</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148742"><span class="hs-identifier hs-var">ev</span></a></span><span>       </span><span class="hs-comment">-- Of type KnownNat/KnownSymbol</span><span>
</span><span id="line-1297"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148738"><span class="annot"><span class="annottext">proxy :: CoreExpr
</span><a href="#local-6989586621681148738"><span class="hs-identifier hs-var hs-var">proxy</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; [Type] -&gt; CoreExpr
forall b. Expr b -&gt; [Type] -&gt; Expr b
</span><a href="GHC.Core.html#mkTyApps"><span class="hs-identifier hs-var">mkTyApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="GHC.Types.Id.Make.html#proxyHashId"><span class="hs-identifier hs-var">proxyHashId</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148737"><span class="hs-identifier hs-var">ty_kind</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148744"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1298"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [Type] -&gt; CoreExpr
forall b. Expr b -&gt; [Type] -&gt; Expr b
</span><a href="GHC.Core.html#mkTyApps"><span class="hs-identifier hs-var">mkTyApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148741"><span class="hs-identifier hs-var">fun</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148744"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148739"><span class="hs-identifier hs-var">dict</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148738"><span class="hs-identifier hs-var">proxy</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1299"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1300"></span><span>    </span><span id="local-6989586621681148737"><span class="annot"><span class="annottext">ty_kind :: Type
</span><a href="#local-6989586621681148737"><span class="hs-identifier hs-var hs-var">ty_kind</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148744"><span class="hs-identifier hs-var">ty</span></a></span><span>
</span><span id="line-1301"></span><span>
</span><span id="line-1302"></span><span>    </span><span class="hs-comment">-- tr_fun is the Name of</span><span>
</span><span id="line-1303"></span><span>    </span><span class="hs-comment">--       typeNatTypeRep    :: KnownNat    a =&gt; Proxy# a -&gt; TypeRep a</span><span>
</span><span id="line-1304"></span><span>    </span><span class="hs-comment">-- of    typeSymbolTypeRep :: KnownSymbol a =&gt; Proxy# a -&gt; TypeRep a</span><span>
</span><span id="line-1305"></span><span>    </span><span id="local-6989586621681148740"><span class="annot"><span class="annottext">tr_fun :: Name
</span><a href="#local-6989586621681148740"><span class="hs-identifier hs-var hs-var">tr_fun</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148737"><span class="hs-identifier hs-var">ty_kind</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#typeNatKind"><span class="hs-identifier hs-var">typeNatKind</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#typeNatTypeRepName"><span class="hs-identifier hs-var">typeNatTypeRepName</span></a></span><span>
</span><span id="line-1306"></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148737"><span class="hs-identifier hs-var">ty_kind</span></a></span><span> </span><span class="annot"><span class="annottext">Type -&gt; Type -&gt; Bool
</span><a href="GHC.Core.Type.html#eqType"><span class="hs-operator hs-var">`eqType`</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="GHC.Builtin.Types.html#typeSymbolKind"><span class="hs-identifier hs-var">typeSymbolKind</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#typeSymbolTypeRepName"><span class="hs-identifier hs-var">typeSymbolTypeRepName</span></a></span><span>
</span><span id="line-1307"></span><span>           </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; Name
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsEvTypeable: unknown type lit kind&quot;</span></span><span>
</span><span id="line-1308"></span><span>
</span><span id="line-1309"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#ds_ev_typeable"><span class="hs-identifier hs-var">ds_ev_typeable</span></a></span><span> </span><span id="local-6989586621681148733"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148733"><span class="hs-identifier hs-var">ty</span></a></span></span><span> </span><span id="local-6989586621681148732"><span class="annot"><span class="annottext">EvTypeable
</span><a href="#local-6989586621681148732"><span class="hs-identifier hs-var">ev</span></a></span></span><span>
</span><span id="line-1310"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; DsM CoreExpr
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;dsEvTypeable&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Type -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148733"><span class="hs-identifier hs-var">ty</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%24%24"><span class="hs-operator hs-var">$$</span></a></span><span> </span><span class="annot"><span class="annottext">EvTypeable -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">EvTypeable
</span><a href="#local-6989586621681148732"><span class="hs-identifier hs-var">ev</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1311"></span><span>
</span><span id="line-1312"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#getRep"><span class="hs-identifier hs-type">getRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Tc.Types.Evidence.html#EvTerm"><span class="hs-identifier hs-type">EvTerm</span></a></span><span>          </span><span class="hs-comment">-- ^ EvTerm for @Typeable ty@</span><span>
</span><span id="line-1313"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.TyCo.Rep.html#Type"><span class="hs-identifier hs-type">Type</span></a></span><span>            </span><span class="hs-comment">-- ^ The type @ty@</span><span>
</span><span id="line-1314"></span><span>       </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.HsToCore.Binds.html#TypeRepExpr"><span class="hs-identifier hs-type">TypeRepExpr</span></a></span><span> </span><span class="hs-comment">-- ^ Return @CoreExpr :: TypeRep ty@</span><span>
</span><span id="line-1315"></span><span>                          </span><span class="hs-comment">-- namely @typeRep# dict@</span><span>
</span><span id="line-1316"></span><span class="hs-comment">-- Remember that</span><span>
</span><span id="line-1317"></span><span class="hs-comment">--   typeRep# :: forall k (a::k). Typeable k a -&gt; TypeRep a</span><span>
</span><span id="line-1318"></span><span id="getRep"><span class="annot"><span class="annottext">getRep :: EvTerm -&gt; Type -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#getRep"><span class="hs-identifier hs-var hs-var">getRep</span></a></span></span><span> </span><span id="local-6989586621681148731"><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148731"><span class="hs-identifier hs-var">ev</span></a></span></span><span> </span><span id="local-6989586621681148730"><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148730"><span class="hs-identifier hs-var">ty</span></a></span></span><span>
</span><span id="line-1319"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148729"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148729"><span class="hs-identifier hs-var">typeable_expr</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">EvTerm -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#dsEvTerm"><span class="hs-identifier hs-var">dsEvTerm</span></a></span><span> </span><span class="annot"><span class="annottext">EvTerm
</span><a href="#local-6989586621681148731"><span class="hs-identifier hs-var">ev</span></a></span><span>
</span><span id="line-1320"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681148728"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148728"><span class="hs-identifier hs-var">typeRepId</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="GHC.Builtin.Names.html#typeRepIdName"><span class="hs-identifier hs-var">typeRepIdName</span></a></span><span>
</span><span id="line-1321"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681148726"><span class="annot"><span class="annottext">ty_args :: [Type]
</span><a href="#local-6989586621681148726"><span class="hs-identifier hs-var hs-var">ty_args</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Type -&gt; Type
Type -&gt; Type
</span><a href="GHC.Core.Type.html#typeKind"><span class="hs-identifier hs-var">typeKind</span></a></span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148730"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Type
</span><a href="#local-6989586621681148730"><span class="hs-identifier hs-var">ty</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-1322"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [CoreExpr] -&gt; CoreExpr
forall b. Expr b -&gt; [Expr b] -&gt; Expr b
</span><a href="GHC.Core.html#mkApps"><span class="hs-identifier hs-var">mkApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; [Type] -&gt; CoreExpr
forall b. Expr b -&gt; [Type] -&gt; Expr b
</span><a href="GHC.Core.html#mkTyApps"><span class="hs-identifier hs-var">mkTyApps</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148728"><span class="hs-identifier hs-var">typeRepId</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Type]
</span><a href="#local-6989586621681148726"><span class="hs-identifier hs-var">ty_args</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681148729"><span class="hs-identifier hs-var">typeable_expr</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1323"></span><span>
</span><span id="line-1324"></span><span class="annot"><a href="GHC.HsToCore.Binds.html#tyConRep"><span class="hs-identifier hs-type">tyConRep</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.TyCon.html#TyCon"><span class="hs-identifier hs-type">TyCon</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Tc.Types.html#DsM"><span class="hs-identifier hs-type">DsM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-1325"></span><span class="hs-comment">-- Returns CoreExpr :: TyCon</span><span>
</span><span id="line-1326"></span><span id="tyConRep"><span class="annot"><span class="annottext">tyConRep :: TyCon -&gt; DsM CoreExpr
</span><a href="GHC.HsToCore.Binds.html#tyConRep"><span class="hs-identifier hs-var hs-var">tyConRep</span></a></span></span><span> </span><span id="local-6989586621681148725"><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148725"><span class="hs-identifier hs-var">tc</span></a></span></span><span>
</span><span id="line-1327"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681148724"><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148724"><span class="hs-identifier hs-var">tc_rep_nm</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">TyCon -&gt; Maybe Name
</span><a href="GHC.Core.TyCon.html#tyConRepName_maybe"><span class="hs-identifier hs-var">tyConRepName_maybe</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148725"><span class="hs-identifier hs-var">tc</span></a></span><span>
</span><span id="line-1328"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681148722"><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148722"><span class="hs-identifier hs-var">tc_rep_id</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Name -&gt; DsM EvVar
</span><a href="GHC.HsToCore.Monad.html#dsLookupGlobalId"><span class="hs-identifier hs-var">dsLookupGlobalId</span></a></span><span> </span><span class="annot"><span class="annottext">Name
</span><a href="#local-6989586621681148724"><span class="hs-identifier hs-var">tc_rep_nm</span></a></span><span>
</span><span id="line-1329"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; DsM CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">EvVar -&gt; CoreExpr
forall b. EvVar -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">EvVar
</span><a href="#local-6989586621681148722"><span class="hs-identifier hs-var">tc_rep_id</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-1330"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-1331"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; DsM CoreExpr
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;tyConRep&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">TyCon -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">TyCon
</span><a href="#local-6989586621681148725"><span class="hs-identifier hs-var">tc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1332"></span></pre></body></html>